title: PHP Undefined Index error -- cannot solve
body: <p>I have tried the solution provided in stack overflow for this problem but could not really solve this problem.</p>
  
  <p>I am working on the code written by someone else. The code is as follows </p>
  
  <pre><code>$web_user = $_SERVER["PHP_AUTH_USER"];
  $file_name = $web_user.'_nefops_var_sel.tab';
  $state['dumper_file_name'] = $file_name;
  $long_file_name = '/tmp/'.$file_name;
  $state['dumper_long_file_name'] = $long_file_name;
  $handle = fopen($long_file_name,'w') or die("bad file open");
  fwrite($handle,$labels);    
  fclose($handle);
  </code></pre>
  
  <p>The error I am getting is 
  A PHP Error was encountered</p>
  
  <blockquote>
    <p>Severity: Notice<br>
    Message: Undefined index: PHP_AUTH_USER<br>
    Filename: models/export_data_model.php<br>
    Line Number: 26</p>
  </blockquote>
  
  <p>Can someone help me with this.</p>