title: simplexml_load_file not loading file
body: <p>I am trying to get the following code to work:</p>
  
  <pre><code>if (isset($_POST['file'])){
      if(file_exists($_POST['file'])){
          echo "here";
          $fixture = simplexml_load_file($_POST['file']) or die ('error');
      }
  }
  </code></pre>
  
  <p>It echoes the 'here' but it does not load the file.</p>
  
  <p>Any ideas?</p>
  
  <hr>
  
  <pre><code>&lt;HTML&gt;
  &lt;HEAD&gt;
  &lt;TITLE&gt;File Upload&lt;/TITLE&gt;
  &lt;/HEAD&gt;
  &lt;BODY&gt;
  &lt;?php
  if ((($_FILES["file"]["type"] == "text/xml"))
  &amp;&amp; ($_FILES["file"]["size"] &lt; 20000))
    {
    if ($_FILES["file"]["error"] &gt; 0)
      {
      echo "Return Code: " . $_FILES["file"]["error"] . "&lt;br /&gt;";
      }
    else
      {
      echo "Upload: " . $_FILES["file"]["name"] . "&lt;br /&gt;";
      echo "Type: " . $_FILES["file"]["type"] . "&lt;br /&gt;";
      echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb&lt;br /&gt;";
      echo "Temp file: " . $_FILES["file"]["tmp_name"] . "&lt;br /&gt;";
  
      if (file_exists(time() . $_FILES["file"]["name"]))
        {
        echo $_FILES["file"]["name"] . " already exists. ";
        }
      else
        {
        move_uploaded_file($_FILES["file"]["tmp_name"],
        time() . $_FILES["file"]["name"]);
        echo "Stored in: " . time() . $_FILES["file"]["name"];
        echo "&lt;form action='league.php' method='post'&gt;";
        echo "&lt;input type='hidden' value='" . time() . 
                      $_FILES["file"]["name"] . "' name='file'&gt;";
        echo "&lt;input type='submit' /&gt;&lt;/form&gt;";
        }
      }
    }
  else
    {
    echo "Invalid file";
    }
  ?&gt;
  &lt;/BODY&gt;
  &lt;/HTML&gt;
  </code></pre>
  
  <p>The file being uploaded is an XML file and the filename is posted as a hidden variable to the previous code.</p>
  
  <hr>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;title&gt;Results&lt;/title&gt;
  &lt;results&gt;
      &lt;result&gt;
          &lt;hometeam&gt;
              &lt;name&gt;Team A&lt;/name&gt;
              &lt;score&gt;6&lt;/score&gt;
          &lt;/hometeam&gt;
          &lt;awayteam&gt;
              &lt;name&gt;Team B&lt;/name&gt;
              &lt;score&gt;0&lt;/score&gt;
          &lt;/awayteam&gt;
      &lt;/result&gt;
  &lt;/results&gt;
  </code></pre>