Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <link rel="stylesheet" type="text/css" href="style_sheet.css">
- </head>
- <body>
- <?php
- $username1 = $_POST["username"];
- $password1 = md5($_POST["password"]);
- $email = $_POST["email"];
- $my_date = date("Y-m-d H:i:s");
- $servername = "localhost";
- $username = "username";
- $password = "password";
- $dbname = "lab3";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql = "INSERT INTO User( email, username, password,Registration_Date)
- VALUES ('$email','$username1','$password1', '$my_date')";
- if ($conn->query($sql) === TRUE) {
- echo "Welcome ".$username1." !<br>";
- } else {
- echo "Error: " . $sql . "<br>" . $conn->error;
- }
- $conn->close();
- # INSERT INTO User( 'username', 'email', 'password', 'registration_date');
- # VALUES (username,email,password, date1);
- ?> <br>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement