I was trying to make the following script work, but when I run the script, I get this error:
"Warning: open_basedir restriction in effect. File is in wrong directory in /usr/local/psa/home/vhosts/gamerzlive.com/httpdocs/upload/index.php on line 49
upload failed!"
I chomoded the folder to 777 and did everything that I was suppose to do but still not working.
You can see the script here: www.gamerzlive.com/upload/index2.php . (Netscape is not supported.)
<body bgcolor="ededed">
<div align="center"><img src="logo.gif" width="400" height="60"><br>
</div>
<FORM ENCTYPE="multipart/form-data" ACTION="" METHOD="POST">
<p align="center">
<INPUT NAME="userfile" TYPE="file" style="border-style: dashed; border-color: #333333; background-color: #ededed; border-width: 1px">
<br>
<br>
<INPUT TYPE="submit" VALUE="Upload" style="border-style: dashed; border-color: #333333; background-color: #d2d2d2; border-width: 1px">
</p>
</FORM>
<?php
// Image file upload by Bloody
$path = "/usr/local/psa/.......live.com/httpdocs/upload/";
$max_size = 200000;
if (is_uploaded_file($userfile)) {
if ($userfile_size>$max_size) { echo "The file is too big<br>\n"; exit; }
if (($userfile_type=="image/gif") || ($userfile_type=="image/pjpeg")) {
if (file_exists($path . $userfile_name)) { echo "The file already exists<br>\n"; exit; }
$res = copy($userfile, $path . $userfile_name); (((((((((((((<---- Line 49 ))))))))))))))
if (!$res) {
echo "upload failed!<br>\n"; exit; }
else
echo "upload sucessful<br>\n";
echo "File Name: $userfile_name<br>\n";
echo "File Size: $userfile_size bytes<br>\n";
echo "File Type: $userfile_type<br>\n";
} else { echo "Wrong file type<br>\n"; exit; }
}
?>
------------------------------------------------------------------------.
I would really appreciate any help. Thanks.