Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title></title>
- </head>
- <body style="background-color: rgb(229,243,247);">
- <?php
- /* This page receives and handles the data generated by "MovieForm.html". */
- // Trim the incoming data.
- $username = trim($_POST['username']);
- $password = trim($_POST['password']);
- // to prevent mysql injection
- $username = stripcslashes($username);
- $password = stripcslashes($password);
- $username = mysql_real_escape_string($username);
- $password = mysql_real_escape_string($password);
- // Set the variables for the database access:
- $servername = "localhost";
- $uname = "root";
- $pw = "";
- $dbname = "login";
- // connect
- $connection = new mysqli($servername, $uname, $pw, $dbname);
- if($connection->connect_error){
- die("Connect failed: " . $conn->connect_error);
- }
- $sql = "INSERT INTO $dbname (username,password) VALUES ('$username','$password')";
- if($connection->query($sql) === TRUE){
- echo "New record created successfully";
- }else{
- echo "Sucks to suck " . $sql . "<br>" . $connection->error;
- }
- $connection->close();
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement