title: How to make the program read the time generated text files on question.php?
body: <p>The file has a 2 texboxes submit button when it is tapped the data is put into the newly created file.Each new created file 
  I have file j.php  that creates a texfile question.$myDate.txt creates a  new txt file with a unique name and $question1 represents the question and it is put in the textfile data as the first  element the sign "," splits $question1 and $question2. The variable $question2 represents the answer. And is put the second element in the text file.
  The second file questions.php opens instntly after the button is submitted the file is supposed the read adn split the data of the text file and read it and dispay it once the texfile is split into two elements since the text files contains two elements. The first one shows up as a question and the texbox in should be written an answer and the form would be submitted.
  But the problem on file 2 it  it dosen't read the textfile data. when the text box pops up.</p>
  
  <pre><code>&lt;?php
  
  if(isset($_POST['submit'])) {
          $number =$number +1;
      $myDate = round(10*microtime(TRUE));
      $result ="question".$myDate.".txt";
      $question1 = $_POST['name'];
      $question2 = $_POST['age'];
      $file = fopen( $result, "w+" ) or die( "file not open" );
      $s = $question1 . "," . $question2 . "\n";
      fputs($file, $s)or die("Data not written");
  
      // Here - redirect to questions.php to display the contents.
      header('Location: questions.php');
      die;
  }
  else{
  echo
  '&lt;center&gt;
   &lt;form action = "j.php"  method = "post"&gt;
    &lt;br&gt;Question you want ask the person &lt;input  type  = "text" name="name"&gt; &lt;br&gt;
     &lt;br&gt;Answer&lt;input type = "text" name = "age"&gt;&lt;br&gt;
      &lt;input type = "submit" name = "submit" value = "Make Question"&gt;
      &lt;/form&gt;
      &lt;/center&gt;';}
  ?&gt;
  </code></pre>
  
  <pre><code>&lt;?php
  $myDate = glob("*.txt");
  $myFile = "question".$myDate."txt";
  $fh = fopen($myFile, 'r');
  $theData = fread($fh, filesize($myFile));
  fclose($fh);
  $arr =explode(",",$theData);
  $x=$arr[0];
  $y = $arr[1];
  $text = $_POST["name"];
  $text = true;
  if($_POST['submit']) {
      $text = $_POST["name"];
      if ( $text ==$y) {
  
  
  
          echo "&lt;font color = 'red'&gt;Your answer is incorrect&lt;/font&gt;";
      } else {
          echo "answer not correct";
      }
  
  }
  
  
  ?&gt;
  &lt;center&gt;
      &lt;form  method = "post"&gt;
          &lt;?php echo $x  ?&gt; &lt;input  type  = "text" name="name"&gt; &lt;br&gt;
          &lt;input type = "submit" name = "submit" value = "Submit answer"&gt;
      &lt;/form&gt;
  &lt;/center&gt;
  \\expected output the texfile being read and next to the text box the question popped upp\\
  </code></pre>