<?
$dbconn = mysql_pconnect("localhost","l3lade","*****"); //establish connection w/db
$result = mysql_select_db("Hazardnet", $dbconn); //establish connection w/db
$sql = "SELECT * FROM Hazardnet_users WHERE username='$username'"; //query to return all results where the username equals the username they signed up with
$result = mysql_query($sql); //send the query to the database
if(empty($username) || empty($passwd) || empty($email))
{
echo "<b>Please fill out all fields</b>";
}
else if($result != false){ //make sure there were no errors;database is running
$data = mysql_fetch_assoc( $result );
}else{
echo "<b>There was a problem!</b> ", mysql_error();
}
if(empty($data['username'])){
$result = mysql_query ("INSERT INTO Hazardnet_users (username, passwd, email)
VALUES ('$username', '$passwd', '$email'");
}
?>
it kind of works, but it keeps saying please fill out all fields, help?
heres the registration page to see for yourself:
http://www.hazardnet.net/?hn=register