|
Posted by macca on 08/13/07 23:05
Hi people!
I'm having a problem with a file upload script that I'm writing. It
works with Firefox but not Internet explorer.
When the form is submitted(to it's self) it check for a file upload
using this:
$room_type = $_POST['room_type'];
$sleeps = $_POST['sleeps'];
$description = $_POST['description'];
$count = $_POST['count'];
$cost_per_night = $_POST['cost_per_night'];
// ==============
// Configuration
// ==============
$uploaddir = "../account_images"; // Where the files
to upload
//$thumbs_dir ="account_images/thumbs"; // Where the
thumbnail uploads to
// ==============
// Upload Part
// ==============
if(is_uploaded_file($_FILES['file']['tmp_name']))
{
if(($_FILES['file']["type"] == "image/jpeg") ||
($_FILES['file']["type"] == "image/gif") ||
($_FILES['file']["type"] == "image/png"))
{ //200kb
move_uploaded_file($_FILES['file']
['tmp_name'],$uploaddir.'/'.$_FILES['file']['name']);
$current_file_uploaded = $_FILES['file']
['name'];
$picture_name = $current_file_uploaded;
}
}
Then it runs a function which inputs the info from the form into a db
table like so:
add_room_type_to_db($room_type,$sleeps,$description,$count,
$cost_per_night,$picture_name,$connection);
It works fine when i test it in FF, the image is uploaded and the
image name is inserted into the database, but when i use IE, i get an
E_NOTICE :
"Notice: Undefined variable: picture_name in C:\webserver\webroot
\booking_system\staff\controls.php on line 208"
Line 208 being the line that calls the function "add_room_type_to_db".
Any ideas why this may be happening?
Please help!
Paul
[Back to original message]
|