Help!!! lol
i still cant get it to work! 🙁
this is the code for the form
<form enctype="multipart/form-data" method="post" action="index.php?file=do_upload">
<p><strong>File to Upload:</strong><br></font>
<input type="file" name="img1" size="30"></p>
<P><input type="submit" name="submit" value="Upload File"></p>
and this is the code to insert the name into the database
<?PHP
if ("submit" == $submit) {
$query = mysql_query("INSERT INTO Gallery(ImgName) VALUES('". $_FILES['img1']['name']
."')") or die(mysql_error());
};
?>
This is the code for the do_upload page
<?
if ($_FILES['img1'] != "") {
copy($_FILES['img1']['tmp_name'], "uploads/".$_FILES['img1']['name'])
or die("Couldn't copy the file!");
} else {
die("No input file specified");
}
?>
I know how to open the file from the name once its in the database ...it just wont go into the database!!!((tested by doing SELECT * FROM Gallery))
I just cant figure it out ((although i am a n00b lol))
Thanks
Kane2oo2