Hadi1989

Untitled

Nov 30th, 2018
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1. <?php
  2.     ob_start();
  3.     require_once 'conn.php';
  4.     if(ISSET($_POST['save'])){
  5.         $firstname = $_POST['firstname'];
  6.         $lastname = $_POST['lastname'];
  7.         $address = $_POST['address'];
  8.         $skill = addslashes(implode(", ", $_POST['skill']));
  9.  
  10.         $stmt = mysqli_stmt_init($conn);
  11.         if(mysqli_stmt_prepare($stmt, "INSERT INTO `member` VALUES('', ?, ?, ?, ?)")){
  12.             mysqli_stmt_bind_param($stmt, "ssss", $firstname, $lastname, $address, $skill);
  13.             mysqli_stmt_execute($stmt);
  14.             mysqli_stmt_close($stmt);
  15.            
  16.             header("location:index.php");
  17.         }
  18.        
  19.     }
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment