שיפצתי לך קצת את הקוד..
PHP קוד:
<?php
$link=mysql_connect("localhost","root", "") or die(mysql_error());
mysql_select_db("test", $link) or die(mysql_error());.
$username = $HTTP_POST_VARS['username'];
$password = $HTTP_POST_VARS['password'];
if(isset($username)) {
$query="SELECT * from `users` WHERE `username` = '$username' AND `password` = '$password'";
if (mysql_num_rows($query_of_user) == "0") {
echo "Username already taken";
}
else {
$query1="INSERT INTO `users` (`username`) VALUES ('$username')";
$res=mysql_query($query1,$link);
echo "Thanks for signing up!";
}
}
?>
