Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $db= 'lab3';
- $name = $_POST["name"];
- $pass = md5($_POST["password"]);
- $email = $_POST["email"];
- $date = date("Y-m-d H:i:s");
- //create connection
- $conn= new mysqli('localhost',$name,$pass,$db,$email,$date);
- //check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql = "INSERT INTO user(name, password, email, registration_date)
- VALUES ('$name','$password','$email','$date')";
- if ($conn->query($sql) === TRUE) {
- echo "New record created successfully!!!";
- } else {
- echo "Error: " . $sql . "<br>" . $conn->error;
- }
- $conn->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement