I have solved the form problem now. But know i have a more important problem.
Users sign up by filling a HTML form, which passes the variabes to join.php.
i am trying to 'loop' through the table rows to check if the username or email address has already been used.
the problem is, it only checks the first row in the table. and shows:
This username or email address has already been used...
Go Back and try a different username or email address.
after that it just appears blank.
If there is no username/emailconflict it inserts a new row into the table with the details from the previous form (this works fine), but i just need it to check all the rows of the table, and not just the first 1.
CODE (ive left the db connect code out for security)
$query = "SELECT * FROM members";
$result = mysql_query($query)
or die("Query failed");
while ($row = mysql_fetch_object ($result)) {
$count++;
$rowusername = $row->username;
$rowemail = $row->email;
if ($rowusername == $fusername OR $rowemail == $femail) {
echo "This username or email address has already been used... <BR>";
echo "Go <a href='http://www.gameshots.co.uk/join.htm'>Back</a> and try a different username or email address.";
}else{
$sql = "INSERT INTO members SET username='$fusername', password='$fpassword', fullname='$ffullname', age='$fage', email='$femail', website='$fwebsite', uploads='0', rating='0'";
$query = mysql_query($sql) or die("");
echo "account created";
}
}
this is the only problem preventing me from moving onto the next satge so any help will be extremely appreciated.
Thanks in advance