Running Red Hat Fedora 1, latest updates. MySQL 3.23.58 PHP 4.3.4 Apache
2.0.48.
Uploaded file info not showing up where it's supposed to. Here's the
scenario:
Here is my "form header":
Here is the input field where it gets the filename:
Here is the PHP code that executes this:
if($newfile){
$uploaddir = "/home/nick/http/homepage/userfiles/";
$uploadfile = $uploaddir . $_FILES['$finame']['name'];
if(move_uploaded_file($_FILES['$finame']['tmp_name'], $uploadfile)){
$finame = basename($finame);
$sql = mysql_query("INSERT INTO files SET
filename='$finame', owner='$fiowner', description='$fidesc'");
}
else{
echo " File Upload
Failed.";
echo "";
}
}
Here is the resulting $_FILE values:
Array ( [finame] => Array ( [name] => brian.txt [type] => text/plain
[tmp_name] => /home/nick/dump/phpTFCF0R [error] => 0 [size] => 1627 ) )
Here is the resulting $uploadfile value, and the problem:
/home/nick/http/homepage/userfiles/
Now, I took this code, as you might recognize parts of it, right from
PHP.NET in the part of the manual about "post method uploads". I can't
for the life of me figure out why the filename is not being returned to
that string. Any thoughts?
Nick
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php