
Untitled
By: a guest on
May 5th, 2012 | syntax:
None | size: 1.00 KB | hits: 8 | expires: Never
File upload not working in IE
if (isset($_POST['add'])) {
$order = $_POST['display_order'];
$img = $HTTP_POST_FILES['imagefile']['name'];
$url = $_POST['url'];
// CONNECT TO DB
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$types = array('image/jpeg', 'image/gif', 'image/png', 'image/tiff', 'image/bmp', 'image/pjpeg');
$target_path = "media/";
$target_path = $target_path . basename( $_FILES['imagefile']['name']);
if (in_array($_FILES['imagefile']['type'], $types)) {
if(move_uploaded_file($_FILES['imagefile']['tmp_name'], $target_path)) {
mysql_query(
"INSERT INTO slider_luxury
(display_order, imagefile, url)
VALUES
('$order', '$img', '$url')"
);
header('Location: luxury_slider.php');
} else {
echo "There was an error uploading the slide, please try again!";
}
} else {
echo "FILETYPE NOT SUPPORTED";
}
}
image/x-png