Guest User

Untitled

a guest
May 27th, 2017
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1. <?php
  2. $host = "localhost";
  3. $user = "prog";
  4. $password = "515253a";
  5. $db = "prog";
  6.  
  7. header("Content-Type: text/html; charset=utf-8");
  8.  
  9.  
  10. if (!$conn = mysql_connect($host, $user, $password))
  11. {
  12. echo "<h2>MySQL Error!</h2>";
  13. exit;
  14. }
  15.  
  16. $phone=mysql_real_escape_string($_POST['phone']);
  17. $surname=mysql_real_escape_string($_POST['surname']);
  18. $Street=mysql_real_escape_string($_POST['Street']);
  19.  
  20.  
  21. mysql_select_db($db);
  22.  
  23.  
  24. $result = mysql_query("INSERT INTO `prog`.`directory` ('phone', 'surname' , ' Street') VALUES('$phone', '$surname', '$Street')");
  25.  
  26.  
  27.  
  28. if ($result== true)
  29. {echo "Ваши данные успешно добавлены";}
  30. else{echo "Ваши данные не добавлены";}
  31.  
  32.  
  33.  
  34.      
  35. ?>
Advertisement
Add Comment
Please, Sign In to add comment