}
read my comment towards the move_uploaded_file function
right now.. it works.. but it only moves the $name file.. which is a psd... i want to also move the $gif file
Code: Select all
$name = $_FILES["myfile"]["name"];
$gif = $_FILES["gif"]["name"];
$type = $_FILES["myfile"]["type"];
$size = $_FILES["myfile"]["size"];
$tmp_name = $_FILES["myfile"]["tmp_name"];
$erro = $_FILES["myfile"]["error"];
if ($error > 0 )
die("sory can't upload file code $error");
else
{
if ($size > 1000000)
{
die("that file is not allowed or the size is to big");
}
else
{
move_uploaded_file($tmp_name, "images/" .$name);
//it works up untill this point..... the $name file is created but not the $gif file
move_uploaded_file($tmp_name, "images/" .$gif);
}
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("community") or die(mysql_error());
mysql_query("INSERT INTO psds
(author, name_psd, name_gif) VALUES('scott33', '$name','$gif') ")
or die(mysql_error());
}
?>
heres my upload form
Code: Select all
<html>
<h1>Upload A File</h1>
<form action='upload.php' method='POST' enctype='multipart/form-data'>
Name<p>
<input type='text' name='name'><p>
Description<p>
<input type='text' name='desc'><p>
step 1: upload a psd
<input type='file' name='myfile'><p>
step 2: upload the png or gif
<input type='file' name='gif'><p>
<input type='submit' value='upload'>
</form>
</html>