title: variable define error in PHP picture uploading
body: <p>I'm only a beginner with PHP and server side programming so excuse me for this question about variables. I was reading a tutorial about uploading a photo. </p>
  
  <p><a href="http://www.plus2net.com/php_tutorial/php_file_upload.php" rel="nofollow">(tutorial on plus2net)</a>
  and like described in the tutorial i directly copied and pasted the code after understanding it. However the webpage filled with following errors after i inserted PHP in to the HTML.</p>
  
  <blockquote>
    <p>Notice: Use of undefined constant size - assumed 'size' in C:\Program Files (x86)\XAMPP\htdocs\college_ink\shirtDesign.php on line 44</p>
    
    <p>Notice: Undefined index: file_up in C:\Program Files
    (x86)\XAMPP\htdocs\college_ink\shirtDesign.php on line 44</p>
    
    <p>Notice: Use of undefined constant file_up - assumed 'file_up' in
    C:\Program Files (x86)\XAMPP\htdocs\college_ink\shirtDesign.php on
    line 45</p>
    
    <p>Notice: Use of undefined constant name - assumed 'name' in C:\Program
    Files (x86)\XAMPP\htdocs\college_ink\shirtDesign.php on line 45</p>
    
    <p>Notice: Undefined index: file_up in C:\Program Files
    (x86)\XAMPP\htdocs\college_ink\shirtDesign.php on line 45</p>
    
    <p>Notice: Use of undefined constant file_up - assumed 'file_up' in
    C:\Program Files (x86)\XAMPP\htdocs\college_ink\shirtDesign.php on
    line 47</p>
    
    <p>Notice: Use of undefined constant size - assumed 'size' in C:\Program
    Files (x86)\XAMPP\htdocs\college_ink\shirtDesign.php on line 47</p>
    
    <p>Notice: Undefined index: file_up in C:\Program Files
    (x86)\XAMPP\htdocs\college_ink\shirtDesign.php on line 47</p>
    
    <p>Notice: Use of undefined constant file_up - assumed 'file_up' in
    C:\Program Files (x86)\XAMPP\htdocs\college_ink\shirtDesign.php on
    line 51</p>
  </blockquote>
  
  <p>This is the PHP Code: </p>
  
  <pre><code>&lt;?Php
      $file_upload="true";
      $file_up_size=$_FILES['file_up'][size];
      echo $_FILES[file_up][name];
  
      if ($_FILES[file_up][size]&gt;500000){
      $msg=$msg."Uploaded file size more than 500KB&lt;BR&gt;";
      $file_upload="false";}
  
      if (!($_FILES[file_up][type] =="image/jpeg" OR $_FILES[file_up][type] =="image/png")){
      $msg=$msg."Your uploaded file must be of JPG or PNG.&lt;BR&gt;";
      $file_upload="false";}
  
      $file_name=$_FILES[file_up][name];
      $add="upload/$file_name"; //the path with the file name
  
      if($file_upload=="true"){
          if(move_uploaded_file ($_FILES[file_up][tmp_name], $add)){
          //do your coding here to give a thanks message
  
          }
          else{
              echo "Failed to upload file.";}
              }
      else{
          echo $msg;
          }
      ?&gt;
  </code></pre>
  
  <p>I've corrected the variable error but I'm getting this error now instead</p>
  
  <blockquote>
    <p>Notice: Undefined index: file_up in C:\Program Files
    (x86)\XAMPP\htdocs\college_ink\shirtDesign.php on line 44</p>
  </blockquote>
  
  <p>Please guide me through this. :)</p>