Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- newusr.html:
- <html>
- <head>
- <title>Quiz Site New Users Registration</title>
- </head>
- <body>
- <form action="newusr.php" method="post">
- Full name: <input type="text" name="name"><br>
- Country of residence: <SELECT NAME="country"" SIZE="1">
- <OPTION VALUE="1">United Kingdom
- <OPTION VALUE="2">United States
- <OPTION VALUE="3">Somewhere else in the world
- </select><br>
- E-mail address: <input type="text" name="email"><br>
- Username: <input type="text" name="usrname"><br>
- Password: <input type="password" name="userpass"><br>
- <input type="Submit">
- </form>
- newusr.php:
- <?php
- $dbuser='xxx';
- $dbpass='xxx';
- $dbname='xxx';
- $dblocation='localhost';
- $userid = uniqid();
- $name=$_POST['name'];
- $country=$_POST['country'];
- $email=$_POST['email'];
- $usrname=$_POST['usrname'];
- $userpass=$_POST['userpass'];
- mysql_connect($dblocation, $dbuser, $dbpass)
- OR DIE ("Connection failed");
- mysql_select_db($dbname)
- OR DIE ("Database not found");
- $query = "INSERT INTO player (player_id, player_name, player_country, player_email, player_username, player_password) VALUES ($userid,'$name','$country','$email','$usrname','$userpass')"
- //OR DIE (mysql_error());
- mysql_query($query);
- echo "Done";
- mysql_close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement