title: Issue with uploading .csv file with my provider
body: <p>Hey guys so since switching from Winhost to Media Temple my .csv uploader has no been working.  I am running a totally dedicated server and it is all self managed and when I check the system error_logs.file I get:</p>
  
  <pre><code>[Sat Mar 30 04:47:53 2013] [warn] [client ip] mod_fcgid: stderr: PHP Notice:  Undefined variable: seterror in mysite/getAccountsCSV.php on line 40, referer: mysite/memberinterface.php
  [Sat Mar 30 04:47:53 2013] [warn] [client ip] mod_fcgid: stderr: PHP Notice:  Undefined index: csvfile in mysite/getAccountsCSV.php on line 42, referer: mysite/memberinterface.php
  [Sat Mar 30 04:47:53 2013] [warn] [client ip] mod_fcgid: stderr: PHP Warning:  fopen(): Filename cannot be empty in mysite/getAccountsCSV.php on line 44, referer: mysite/memberinterface.php
  [Sat Mar 30 04:47:53 2013] [warn] [client ip] mod_fcgid: stderr: PHP Warning:  fgetcsv() expects parameter 1 to be resource, boolean given in mysite/getAccountsCSV.php on line 46, referer: mysite/memberinterface.php
  [Sat Mar 30 04:47:53 2013] [warn] [client ip] mod_fcgid: stderr: PHP Warning:  array_map(): Argument #2 should be an array in mysite/getAccountsCSV.php on line 48, referer: mysite/memberinterface.php
  [Sat Mar 30 04:47:53 2013] [warn] [client ip] mod_fcgid: stderr: PHP Warning:  array_map(): Argument #2 should be an array in mysite/getAccountsCSV.php on line 48, referer: mysite/memberinterface.php
  [Sat Mar 30 04:47:53 2013] [warn] [client ip] mod_fcgid: stderr: PHP Warning:  array_search() expects parameter 2 to be array, null given in mysite/getAccountsCSV.php on line 50, referer: ./memberinterface.php
  and it keeps going....
  </code></pre>
  
  <p>Heres my code:</p>
  
  <pre><code>if (!empty($_FILES['csvfile']['error'] ) )
      {
  
          $seterror = 1;
          returnBack();
  
      } 
      if (empty($_POST['firstname'])){
  
          $seterror =1;
          returnBack();
      }
      if (empty($_POST['lastname'])){
          $seterrro =1;
  
          returnBack();
      }
      if (empty($_POST['email'])){
          $seterror =1;
  
          returnBack();
      }
      if ($seterror != 1){
  
      $file = $_FILES['csvfile']['tmp_name']; 
      var_dump($file);
      $handle = fopen($file , "r");
  
      $fileop = fgetcsv($handle,1000,",");
  
      $fileop=array_map("strtoupper",array_map("trim",$fileop));
  
      $firstname_index = array_search(strtoupper($_POST["firstname"]),$fileop);
      if ($firstname_index===false){
          returnBack();
      }
      $lastname_index = array_search(strtoupper($_POST['lastname']),$fileop);
      if ($lastname_index===false){
  
          returnBack();
      }
      $email_index = array_search(strtoupper($_POST['email']),$fileop);
      if ($email_index===false){
  
          returnBack();
      }
          //open file and store values
          while (($fileop=fgetcsv($handle)) !== false)
          {
  
              $fileop=array_map("trim",$fileop);
              $firstname[$j] = $fileop[$firstname_index];
              if (empty($firstname[$j])){ 
              exit;
              returnBackfile();
  
              }
  
              $lastname[$j] = $fileop[$lastname_index];
                  if (empty($lastname[$j])){
                      exit;
              returnBackfile();
  
              }
              $email[$j] = $fileop[$email_index];
                  if (empty($email[$j])){
              exit;
              returnBackfile();
  
  
              }
              $j++;
          }
  
          print_r($firstname);
  
  
      }
  </code></pre>
  
  <p>I have a form that is sent from a jquery ui-dialog div.....the user can upload file and info and is sent to here.  Please if you have any idea what I can do to fix this I would appreciate it!  I don't know if its a server issue like some settings that need to be changed or what?</p>
  
  <p>EDIT:</p>
  
  <p>Here is the top of the file before the if(!empty($_FIL.....</p>
  
  <pre><code>$setereror = 0;
  $j = 0;
  function returnBack(){
  
      header("Location:../memberinterface.php?getmsg=15");
      exit;
  
  }
  function returnBackfile(){
  
      header("Location:../memberinterface.php?getmsg=16");
      exit;
  
  }
  </code></pre>