Hehe, no problem![]()
I keep getting the msg tht no image has been selected, and i have...please advise....
Did you type the URL correctly?
Can you show us your code ?
Why wont u post my msgs!!!!!!!
Well.. you can post them here ? You have already posted 2 messages..
add.html
Code:<title>Upload form</title> <form id='Upload' enctype="multipart/form-data" action="insert.php" method="post" name="changer"> <input name="MAX_FILE_SIZE" value="102400" type="hidden"> <h1> Upload Form </h1> <label for="file">File to upload:</label> <input id="file" type="file" name="file"> <label for="submit">Press to...</label> <input id="submit" type="submit" name="submit" value="Upload me!" </head> <body> </form> </body> </html>
Last edited by Jaan; 03-01-2010 at 05:14 PM. Reason: Please use code tags when you are posting your codes!
What the...?
That is a serious case of malformed HTML over there.
I'll try to "fix" the HTML code, but this still won't fix anything since this is just the upload form and nothing else.
HTML Code:<html> <head> <title>Upload form</title> </head> <body> <form id='Upload' enctype="multipart/form-data" action="insert.php" method="post" name="changer"> <input name="MAX_FILE_SIZE" value="102400" type="hidden"> <h1> Upload Form </h1> <label for="file">File to upload:</label> <input id="file" type="file" name="file"> <label for="submit">Press to...</label> <input id="submit" type="submit" name="submit" value="Upload me!" </form> </body> </html>
Hi guys! Finally this **** thing lets me sign in and type properly. I just want to say that i thought i had pasted all my code but obviously that didnt happen...
Anyway i have restarted alllll my code over againwhich is a good thing as my understanding of php has slightly increased.
This code wont work at all! I have tried and re-checked everything soo many time still no luck. Im still a newbie to this so maybe someone else can tell what im doing wrong. I realllly hope this works![]()
Index.php:
database.phpCode:<?php
require_once("database.php");
if(isset($database)) {echo "true"; } else {echo "false"; }
echo "<br />";
echo "is this working?";
?>
config.php:Code:<?php
require_once("config.php");
class MySQLDatabase {
private $connection;
function __construct() {
$this->open_connection();
}
public function open_connection() {
$this->connection = mysql_connect(DB_SERVER, DB_USER, DB_PASS);
if (!$this->connection) {
die("Database connection failed: " . mysql_error());
}else {
$db_select = mysql_select_db(DB_NAME, $this->connection);
if (!db_select) {
die("Database selection failed: " . mysql_error())
}
}
}
public function close_connection(){
if(isset($this->connection)) {
mysql_close($this->connection);
unset($this->connection);
}
}
}
public function query ($sql){
$result = mysql_query($sql, $this->connection);
$this->confirm_query($result);
return $result;
}
public function mysql_prep( $value ){
$magic_quotes_active = get_magic_quotes_gpc();
$new_enough_php = function_exists ("mysql_real_escape_string");
if($new_enough_php) {
if($magic_quotes_active ) { $value = stripslashes($value); }
$value = mysql_real_escape_string($value);
} else {
if($magic_quotes_active) {$value= addslashes($value); }
}
return $vlaue;
}
private function confirm_query ($result) {
if (!$result){
die("Database query failed: " .mysql_error() )
}
}
}
$database = new MySQLDatabase();
$db =& $database;
?>
THANKS IN ADVANCE FOR ANY HELP/ADVICE ITS MUCH APPRECIATED.Code:<?php
//Db constants
defined ('DB_SERVER') ? null : define ="DB_SERVER", "localhost"); // Host name
defined ('DB_USER') ? null : define ="DB_USER", "root"); // Mysql username
defined ('DB_PASS') ? null : define ="DB_PASS", "root"); // Mysql password
defined ('DB_NAME') ? null : define ="DB_NAME", "User"); // Database name
?>
P.S. i've been using a video tutorial, by Lynda.com...thought i'd mention it incase anyone else has used it.
i realise its slightly off-topic opologies if i posted it in the wrong topic thread.
There are currently 2 users browsing this thread. (0 members and 2 guests)
Bookmarks