Advertisement
Guest User

Untitled

a guest
Dec 26th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. <?php
  2.  
  3. function check_input($value) {
  4. $value = trim($value);
  5. $value = stripslashes($value);
  6. $value = htmlspecialchars($value);
  7.  
  8. return $value;
  9. }
  10.  
  11. if(isset($_POST["submit"])){
  12. $user_login = check_input($_POST["login"]);
  13. $user_password = check_input($_POST["password"]);
  14. $user_firstname = check_input($_POST["firstname"]);
  15. $user_lastname = check_input($_POST["lastname"]);
  16. $user_vathername = check_input($_POST["vathername"]);
  17. $user_sex = check_input($_POST["sex"]);
  18. $user_dateBirth = check_input($_POST["dateBirth"]);
  19. $user_address = check_input($_POST["address"]);
  20. $user_phone = check_input($_POST["phone"]);
  21. $user_email = check_input($_POST["email"]);
  22. }
  23.  
  24.  
  25. try{
  26.  
  27. require_once ("datebase.php");
  28.  
  29. $set_local = $conn->prepare('SET lc_time_names="ru_RU"');
  30. $set_local->execute();
  31.  
  32.  
  33.  
  34.  
  35. $select_user = $conn->prepare('INSERT INTO client( password, First_name, Last_name, Vater_name, Sex, Date_birth, Address, Phone, Email) VALUES (:password, :firstname, :laststname, :Vater_name, :Sex, :Date_birth, :Address, :Phone, :Email )');
  36.  
  37.  
  38.  
  39. $select_user ->bindParam(':password', $user_password);
  40. $select_user ->bindParam(':firstname', $user_firstname);
  41. $select_user ->bindParam(':laststname', $user_lastname);
  42. $select_user ->bindParam(':Vater_name', $user_vathername);
  43. $select_user ->bindParam(':Sex', $user_sex);
  44. $select_user ->bindParam(':Date_birth', $user_dateBirth);
  45. $select_user ->bindParam(':Address', $user_address);
  46. $select_user ->bindParam(':Phone', $user_phone);
  47. $select_user ->bindParam(':Email', $user_email);
  48.  
  49. $select_user ->execute();
  50.  
  51.  
  52.  
  53. }
  54.  
  55.  
  56. catch(PDOException $e) {
  57. echo 'ERROR: ' . $e->getMessage();
  58.  
  59. }
  60. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement