Public paste
val
By: DaveDdave | Date: Mar 25 2009 15:36 | Format: PHP | Expires: never | Size: 695 B | Hits: 512

  1. <?php
  2. $username = $_POST['member_name'];
  3. $email = $_POST['member_email'];
  4.  
  5. mysql_select_db($database_database_connection, $database_connection);  
  6. $searchname=sprintf("SELECT member_name, member_email FROM members");    
  7. $search = mysql_query($searchname, $database_connection) or die(mysql_error());
  8. $row_founduser = mysql_fetch_assoc($search);
  9. $userfound = $row_founduser['member_name'];
  10. $emailfound = $row_founduser['member_email'];
  11.  
  12.  
  13.   if ($userfound == $username) {
  14.  echo "<span class=warning>Username already in use</span>";
  15.  }       
  16.    if ($email == $emailfound) {
  17.  echo "<span class=warning>Email address already in use</span>";
  18.  }
  19.  else {
  20.  
  21. //Registration stuff here
  22.  
  23. }