title: Notice: Undefined index: image - unable to find the error
body: <p>here is my error.i dont know why it is not working.i checked all the parts but i was unable to find the error.</p>
  
  <blockquote>
    <p>Notice: Undefined index: image in C:\xampp\htdocs\Final\places\Ressave.php on line 27</p>
  </blockquote>
  
  <p>here is my html code that pass the name of input:</p>
  
  <pre><code>&lt;form class="form-horizontal" action="Ressave.php" method="POST" autocomplete="on"&gt;
  &lt;div class="well"&gt;
     &lt;legend&gt;Photos&lt;/legend&gt;
        &lt;div class="control-group"&gt;
           &lt;label class="control-label"&gt;Upload Photo: &lt;/label&gt;
               &lt;div class="controls"&gt;
                     &lt;input name="image" type="file" /&gt;
               &lt;/div&gt;   
       &lt;/div&gt;
  &lt;/div&gt;
  
              &lt;div class="form-actions"&gt;
  
                &lt;button type="submit" class="btn btn-primary"&gt;Submit&lt;/button&gt;
  
                &lt;button type="button" class="btn"&gt;Cancel&lt;/button&gt;
  
              &lt;/div&gt;
  
          &lt;/form&gt;
  </code></pre>
  
  <p>Ressave.php is here and can not recieve the name here,so the error occure.....</p>
  
  <pre><code>&lt;?php
  {       //  Secure Connection Script
      include('../Secure/dbConfig.php'); 
      $dbSuccess = false;
      $dbConnected = mysql_connect($db['hostname'],$db['username'],$db['password']);
  
      if ($dbConnected) {     
          $dbSelected = mysql_select_db($db['database'],$dbConnected);
          if ($dbSelected) {
              $dbSuccess = true;
          } else {
              echo "DB Selection FAILed";
          }
      } else {
              echo "MySQL Connection FAILed";
      }
      //  END Secure Connection Script
  }
  if(! $dbConnected )
  {
    die('Could not connect: ' . mysql_error());
  }
  
  
  {               // File Properties
  
  $file = $_FILES['image']['tmp_name'];   //Error comes from here(here is the prob!)
  
  
  if(!isset($file))
  
      echo "Please Choose an Image.";
  
  else  {
          $image = addslashes(file_get_contents($_FILES['image']['tmp_name']));
  
          $image_size = getimagesize($_FILES['image']['tmp_name']);   
  
          if($image_size == FALSE)
              echo "That is not an image.";
          else 
          {
                  $lastid = mysql_insert_id();
                  echo "Image Uploaded.";             
          }
  }
  
  }
  
  {           //join the post values into comma separated 
  
      $features = mysql_real_escape_string(implode(',', $_POST['features']));
      $parking = mysql_real_escape_string(implode(',', $_POST['parking']));   
      $noise = mysql_real_escape_string(implode(',', $_POST['noise']));       
      $good_for = mysql_real_escape_string(implode(',', $_POST['good_for']));
      $ambience = mysql_real_escape_string(implode(',', $_POST['ambience']));
      $alcohol = mysql_real_escape_string(implode(',', $_POST['alcohol']));
  
  
  }
  
  
  $sql =  "INSERT INTO prestaurant ( ResName, Rating, Food_serve, Features, Parking, noise, Good_For, Ambience, Alcohol, Addition_info, Name, Address1, Zipcode1, Address2, Zipcode2, Address3, Zipcode3, City, Mobile, phone1, phone2, phone3, phone4, Email1, Email2, Fax, Website, image)". 
          "VALUES ('$_POST[restaurant_name]','$_POST[star_rating]','$_POST[food_served]','$features','$parking','$noise','$good_for','$ambience','$alcohol','$_POST[description]','$_POST[name]','$_POST[address1]','$_POST[zipcode1]','$_POST[address2]','$_POST[zipcode2]','$_POST[address3]','$_POST[zipcode3]','$_POST[city]','$_POST[mobile]','$_POST[phone1]','$_POST[phone2]','$_POST[phone3]','$_POST[phone4]','$_POST[email1]','$_POST[email2]','$_POST[fax]','$_POST[url]','$image')";
  
  
  mysql_select_db('place');
  $retval = mysql_query( $sql );
  if(! $retval )
  {    
    die('Could not enter data: ' . mysql_error());
  }
  echo "Entered data successfully\n";
  mysql_close($dbConnected);
  ?&gt;
  </code></pre>