My server runs in safe mode but I don't think it's a safe mode restriction. Basically what I've got is a simple for with the enctype thing in the form bit and one of the fields being <input type="file" name="location"> but I'm receiving the following error:
Warning: stat failed for images/1.jpg (errno=2 - No such file or directory) in /home/virtual/site56/fst/var/ on line 1001
but the directory does exist. Here's the part which does the upload:
if ($location == ""
{
exit('Error: No file selected to upload');
} else {
$test = $HTTP_POST_FILES[location][name];
$test = substr($test, -4);
if ($test == ".jpg" XOR $test == ".png" XOR $test == ".gif" XOR $test == ".JPG" XOR $test == ".PNG" XOR $test == ".GIF" XOR $test == "jpeg" XOR $test == "JPEG"
{
if ($test == "JPEG" xor $test == "jpeg"
{
$test = ".jpeg";
}
$image = "images/1$test";
move_uploaded_file($location, "$image"
;
} else {
exit('Error: Wrong File Type');
}
echo 'Successfully added';
}
I'd be greatful for your help. Thanx
Warning: stat failed for images/1.jpg (errno=2 - No such file or directory) in /home/virtual/site56/fst/var/ on line 1001
but the directory does exist. Here's the part which does the upload:
if ($location == ""

exit('Error: No file selected to upload');
} else {
$test = $HTTP_POST_FILES[location][name];
$test = substr($test, -4);
if ($test == ".jpg" XOR $test == ".png" XOR $test == ".gif" XOR $test == ".JPG" XOR $test == ".PNG" XOR $test == ".GIF" XOR $test == "jpeg" XOR $test == "JPEG"

if ($test == "JPEG" xor $test == "jpeg"

$test = ".jpeg";
}
$image = "images/1$test";
move_uploaded_file($location, "$image"

} else {
exit('Error: Wrong File Type');
}
echo 'Successfully added';
}
I'd be greatful for your help. Thanx