title: If else statement that redirects to another page
body: <p>I'm terrible with PHP/SQL, so any help would be appreciated. </p>
  
  <p>Basically I have a form that posts the values 'firstname' &amp; 'surname' to another page. What I want that page to do, is check to see if the user's name is already on the table 'Members'. If it is I want it to continue loading this page, but if they aren't on the database, I want the viewer to be re-directed to an existing sign up page.</p>
  
  <p>Here is the code I've been working on, I'm not sure if I'm heading in the right direction or not.</p>
  
  <pre><code>&lt;?php
  $con = mysql_connect("localhost","site","xxxxxxxx");
  if (!$con)
     {
     die('Could not connect: ' . mysql_error());
     }
  
  mysql_select_db("site", $con);
  
  $query = "SELECT * FROM Members WHERE firstname='$_POST[firstname]' and surname='$_POST[surname]'";  
  $result = mysql_query($query);
  
  if ($result==$something)
     {
     echo "great success"; //user continues loading page
     }
  else
     {
     echo "fail"; //user is redirected to sign up page
     }
  ?&gt;
  </code></pre>