Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST['logjob'])){
- $host = '';
- $user = '';
- $pass = '';
- $db = '';
- $conn = new mysqli($host, $user, $pass, $db);
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $name = $conn->escape_string($_POST['name']);
- $email = $conn->escape_string($_POST['email']);
- $sql = "INSERT INTO users (name, email) VALUES ('$name','$email')";
- if ($conn->query($sql) === TRUE) {
- echo "<script type= 'text/javascript'>alert('New record created successfully - returning to home.');</script>";
- }
- else {
- echo "<script type= 'text/javascript'>alert('Error: " . $sql . "<br>" . $conn->error."');</script>";
- }
- $conn->close();
- }
- ?>
Add Comment
Please, Sign In to add comment