Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- echo "<h1>Register</h1>";
- //form data
- if($_SERVER['REQUEST_METHOD'] == "POST") //This code works,nothing else does!
- {
- $fullname = strip_tags($_POST['fullname']);
- $username = strip_tags($_POST['username']);
- $password = strip_tags($_POST['password']);
- $repeatpassword = strip_tags($_POST['repeatpassword']);
- $email = strip_tags($_POST['email']);
- $steam = strip_tags($_POST['steam']);
- $xfire = strip_tags($_POST['xfire']);
- $date = date("Y-m-d");
- }
- if($_SERVER['REQUEST_METHOD'] == "POST")
- {
- //check for existence
- if ($fullname&&$username&&$password&&$repeatpassword&&$email)
- {
- if ($password==$repeatpassword)
- {
- if (strlen($username)>50||(strlen($username)<6))
- {
- echo "Length of username is too long";
- }
- else
- {
- if (strlen($password)<6)
- {
- echo "Your password must be of 6 or more characters";
- }
- else
- {
- $password = md5($password);
- $repeatpassword = md5($repeatpassword);
- $connect = mysql_connect("localhost","b3fantastico","password");
- mysql_select_db("phplogin"); //Select Database
- $queryreg = mysql_query("INSERT INTO users VALUES ('', '$fullname', '$username', '$password', '$email', '$steam', '$xfire', '$date')") or die(mysql_error());
- die ("You have been registered");
- }
- }
- }
- else
- echo "Your passwords do not match";
- }
- else
- echo "Please fill in all fields";
- }
- ?>
Add Comment
Please, Sign In to add comment