title: Notice: Undefined index: uploaded_file
body: <pre><code>&lt;?php
  
  require_once('connect.php');
  if(isset($_SESSION['username']) &amp; !empty($_SESSION['username'])){
      $fileName = $_FILES["uploaded_file"]["name"]; $fileTmpLoc =
      $_FILES["uploaded_file"]["tmp_name"]; $fileType =
      $_FILES["uploaded_file"]["type"];  $fileSize =
      $_FILES["uploaded_file"]["size"];  $fileErrorMsg =
      $_FILES["uploaded_file"]["error"]; $data = date("Y-m-d-H-i-s");
  
      $nr= rand(1, 30); $kaboom = explode(".", $fileName);  $fileExt =
      end($kaboom);    if (!$fileTmpLoc) { 
      echo "";
      exit();      
  } else if($fileSize &gt; 15242880) { 
      echo "Imagine &gt; 15MB";
      unlink($fileTmpLoc); 
      exit();      
  } else if (!preg_match("/.(gif|jpg|jpeg|png)$/i", $fileName) ) {
  
      echo "Format permis gif/png/jpeg/jpg";
      unlink($fileTmpLoc); 
      exit();      
  } else if ($fileErrorMsg == 1) { 
      echo "Incercati din nou";
      exit(); 
  }    
  $moveResult = move_uploaded_file($fileTmpLoc, "galerie/uploads/$nr$username.jpeg");
  
  if ($moveResult != true) {
      echo "Fisierul NU a fost incarcat";
      unlink($fileTmpLoc); 
      exit(); } 
  
      include_once("ak_php_img_lib_1.0.php"); $target_file =
      "galerie/uploads/$nr$username.jpeg"; $resized_file =
      "galerie/uploads/r$nr$username.jpeg"; $edit_target =
      "$nr$username.jpeg"; 
      $wmax = 300; 
      $hmax = 300;
  
      ak_img_resize($target_file, $resized_file, $wmax, $hmax, $fileExt);
      $_SESSION['editname'] = $edit_target; 
      header("Refresh:0");    
      exit();     
   } else {       
      session_destroy();          
      require "../login.php"; 
  } 
  ?&gt;
  </code></pre>
  
  <p>Until upload a file, I recived this errors:</p>
  
  <blockquote>
    <p>Notice: Undefined index: uploaded_file in
    E:\LICENTA\xampp\htdocs\licentaCC\galerie\image_upload_script.php on
    line 42</p>
    
    <p>Notice: Undefined index: uploaded_file in
    E:\LICENTA\xampp\htdocs\licentaCC\galerie\image_upload_script.php on
    line 43</p>
    
    <p>Notice: Undefined index: uploaded_file in
    E:\LICENTA\xampp\htdocs\licentaCC\galerie\image_upload_script.php on
    line 44</p>
    
    <p>Notice: Undefined index: uploaded_file in
    E:\LICENTA\xampp\htdocs\licentaCC\galerie\image_upload_script.php on
    line 45</p>
    
    <p>Notice: Undefined index: uploaded_file in
    E:\LICENTA\xampp\htdocs\licentaCC\galerie\image_upload_script.php on
    line 46</p>
  </blockquote>
  
  <p>Can anyone help me to solve this problem?</p>