Jump to content

Can Somebody Help Me Now


Panta
 Share

Recommended Posts

// connect to the mysql database server.mysql_connect ($dbhost, $dbusername, $dbuserpass);mysql_select_db($dbname) or die("Cannot select database");//Are they just getting here or submitting their info?if (isset($_POST["username"])) {$username = $_POST["username"];$password = $_POST["password"];$cpassword = $_POST["cpassword"];$email = $_POST["email"];//Was a field left blank?if($username==NULL|$password==NULL|$cpassword==NULL|$email==NULL) {echo "A field was left blank.";}else{//Do the passwords match?if($password!=$cpassword) {echo "Passwords do not match";}else{//Has the username or email been used?$checkuser = mysql_query("SELECT username FROM users WHERE username='$username'");$username_exist = mysql_num_rows($checkuser);$checkemail = mysql_query("SELECT email FROM users WHERE email='$email'");$email_exist = mysql_num_rows($checkemail);if ($email_existɬ|$username_existɬ) {echo "The username or email is already in use";}else{$pin = rand(1000000000,9999999999);//Everything seems good, lets insert.$query = "INSERT INTO users (username, password, email,regno) VALUES('$username','$password','$email','$pin')";mysql_query($query) or die(mysql_error());echo "The user $username has been successfully registered.";echo "Your reg no is" $pin;}}}}?><h1>Register</h1><form action="register.php" method="POST"><table style="border:1px solid #000000;"><tr><td align="right">Username: <input type="text" size="15" maxlength="25" name="username"></td></tr><tr><td align="right">Password: <input type="password" size="15" maxlength="25" name="password"></td></tr><tr><td align="right">Confirm Password: <input type="password" size="15" maxlength="25" name="cpassword"></td></tr><tr><td align="right">Email: <input type="text" size="15" maxlength="25" name="email"></td></tr><tr><td align="center"><input type="submit" value="Register"></td></tr><tr><td align="center"><a href="login.php">Login Here</a></td></tr></table></form></center>

This is my script but i don't know where the problem is coming from.i guess the script is having a little erro.Plz help me

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...