Jump to content

Problem


zeeshan

Recommended Posts

<?session_start(); include("database.php");function usernameTaken($username){   global $conn;   if(!get_magic_quotes_gpc()){	  $username = addslashes($username);   }   $q = "select username from users where username = '$username'";   $result = mysql_query($q,$conn);   return (mysql_numrows($result) > 0);}function addNewUser($username, $password,$confirm password,$email){   global $conn;   $q = "INSERT INTO users VALUES ('$username', '$password','$confirm password','$email')";   return mysql_query($q,$conn);}?><html><title>Sign up</title><body><h1>Register</h1><form action="<? echo $HTTP_SERVER_VARS['PHP_SELF']; ?>" method="post"><table align="left" border="0" cellspacing="0" cellpadding="3"><tr><td>Username:</td><td><input type="text" name="username" maxlength="50"></td></tr><tr><td>Password:</td><td><input type="password" name="pass" maxlength="50"></td></tr><tr><td>confirm password:</td><td><input type="password" name="confirm password" maxlength="30"></td></tr><tr><td>email:</td><td><input type="text" name="Email" maxlength="30"></td></tr><tr><td colspan="2" align="right"><input type="submit" name="subjoin" value="Sign up"></td></tr></table></form></body></html><?}?>

this is an register.php i dont know why its not working as iam a beiginnier the script is confusing me please need help

Link to comment
Share on other sites

Dude, you seriously need to learn PHP before you try to do this stuff. Copy&paste-ing is not going to cut it.The first, and by far the real cause of your problem is that you never "activate" anything. You just "define" actions ("functions" really) which PHP may do later.And anyway, what's in database.php?Again. READ THE TUTORIAL!!! Experiment with simpler stuff first, like entering a name in a field, and then outputting "Hello $user".

Link to comment
Share on other sites

the thing which u said is right but i have learnt but iam not understanding it.do u have any demonstration tecniques using which i can learn it in a month and become a php scriptor and do i have to learn c and c++ first

Link to comment
Share on other sites

do u have any demonstration tecniques using which i can learn it in a month and become a php scriptor
Check out the wonderful resource at http://www.w3schools.com/php/ ! :)
and do i have to learn c and c++ first
No
Link to comment
Share on other sites

By the way, if you are thinking of learning C or C++ it is better to learn one, but not both, as C++ is object oriented while C isn't. Learning both, especially simultaneously, can be very confusing.

Link to comment
Share on other sites

Slightly, but really, there is no point, as you have to spend more time first learning C (which IMO is harder than PHP), then learn PHP, and even if you then can learn PHP in half the time that is still around half the time longer than just learning PHP would have taken.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...