Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $con = mysql_connect("localhost","root","");
- if (!$con)
- {
- die('Could not connect: ' . mysql_error());
- }
- if(empty($_POST['username'])){
- echo "Empty username!";
- }
- if(empty($_POST['password'])){
- echo "Empty password";
- }
- mysql_select_db("users", $con);
- mysql_query("INSERT INTO users (username, password )
- VALUES ('$username', '$password')");
- echo "Registration Succesful";
- mysql_close($con);
- ?>
- <!DOCTYPE html>
- <html>
- <body>
- <form action="">
- Username: <input type="text" name="username"><br>
- Password: <input type="password" name="password"></form>
- </body>
- </html>
Add Comment
Please, Sign In to add comment