I am trying to set up accounts for my website, using mysql. I have the registration page working; however, I cannot get the verification page (the page I'm using to assure that all of the fields meet my requirements) to work. So far this is all I have:
Code: Select all
<?php
include('config.php'); //config.php is the file where I connect to the database
//This verifies that the username is alfanumeric
$test=$_POST[username];
if (!eregi("([^A-Za-z0-9]"),$test)){
//test for duplicate names
$query="SELECT * FROM userbase WHERE username='$test'";
$result=mysql_query($query);
$num=mysql_num_rows($result);
if ($num == 0){
}else{
header("Location:invalidname.html");
}
else{
header("Location:invalidname.html");
}
?>