title: php form that let's students check his/her mark after entering a correct ID number
body: <p>I'm working on it now for a full day with no success. I'm just a beginner. I have a webpage for the course I'm teaching and I want to write a form that lets students check their mark after they enter their student number. I wrote the following form:</p>
  
  <pre><code>  &lt;strong&gt;Mid- term Grades:&lt;/strong&gt;
      &lt;p&gt;
          &amp;nbsp;&lt;/p&gt;
          &lt;form action="Mark.php" method="post"&gt;
          Enter your 7-digit Student Number: &lt;input name="SNumber" size="7"      type="text" /&gt; &lt;input type="submit" value="View Mark" /&gt; &lt;input type="reset" /&gt;&amp;nbsp;&lt;/form&gt;
  </code></pre>
  
  <p>and I put this form in my webpage that is written in html. Now, I want to check if the student number that is entered is in my class if yes show the mark if no say you are not in this section:</p>
  
  <pre><code>&lt;?php
  
  $SNumber = mysql_real_escape_string($_POST['SNumber']);
  $sql = "SELECT * FROM table WHERE name = '$SNumber'";
  $res = mysql_query($query, $connection);
  if (mysql_num_rows($res) &lt;= 0 ) $error = "You are not registered in this section.";
  else{mysql_query(echo "$Mark")
  
  ?&gt;
  </code></pre>
  
  <h2>My Questions:</h2>
  
  <ol>
  <li><p>If I put the validation command on the very top of my page for the course (as I read in internet) my page will die and become a blank page. What is the problem? How i can fix this?</p></li>
  <li><p>I don't know how to store my information (student numbers and the corresponding marks) is it:</p>
  
  <pre><code>SNumber=1234567 Mark= 122 | Snumber=1234577 Mark=3 | SNumber=1034567 Mark= 122
  </code></pre>
  
  <p>Where to store my data how to store my data how to verify an input how to find and print the mark</p></li>
  <li><p>Am I supposed to be good if I include the first form with post method in my course page. Adding verification command on the top of my course page (in my case it kills my page) and storing the information in the format I mentioned above in a php file called Mark.php? Nothing is working for me.</p></li>
  </ol>