Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 1.00 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. File upload not working in IE
  2. if (isset($_POST['add'])) {
  3.  
  4.   $order = $_POST['display_order'];
  5.   $img = $HTTP_POST_FILES['imagefile']['name'];
  6.   $url = $_POST['url'];
  7.  
  8.   // CONNECT TO DB
  9.   mysql_connect(localhost,$username,$password);
  10.   @mysql_select_db($database) or die( "Unable to select database");
  11.  
  12.  
  13.   $types = array('image/jpeg', 'image/gif', 'image/png', 'image/tiff', 'image/bmp', 'image/pjpeg');  
  14.   $target_path = "media/";
  15.   $target_path = $target_path . basename( $_FILES['imagefile']['name']);
  16.  
  17.   if (in_array($_FILES['imagefile']['type'], $types)) {
  18.  
  19.     if(move_uploaded_file($_FILES['imagefile']['tmp_name'], $target_path)) {
  20.  
  21.       mysql_query(
  22.         "INSERT INTO slider_luxury
  23.            (display_order, imagefile, url)
  24.          VALUES
  25.            ('$order', '$img', '$url')"
  26.       );
  27.  
  28.       header('Location: luxury_slider.php');
  29.  
  30.     } else {
  31.  
  32.       echo "There was an error uploading the slide, please try again!";
  33.  
  34.     }
  35.  
  36.   } else {
  37.  
  38.     echo "FILETYPE NOT SUPPORTED";
  39.  
  40.   }  
  41.  
  42. }
  43.        
  44. image/x-png