Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once 'conn.php';
- if(ISSET($_POST['save'])){
- if(!empty($_POST['firstname']) && !empty($_POST['lastname']) && !empty($_POST['city']) && !empty($_POST['postal_code'])){
- $firstname = $_POST['firstname'];
- $lastname = $_POST['lastname'];
- $city = $_POST['city'];
- $postal_code = $_POST['postal_code'];
- $conn->query("INSERT INTO `member` VALUES('', '$firstname', '$lastname', '$city', '$postal_code')") or die(mysqli_errno());
- header('location: index.php');
- }else{
- echo "<script>alert('Please complete the required field!')</script>";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment