Guest User

Untitled

a guest
Dec 30th, 2016
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. <?php
  2. error_reporting(E_ALL);
  3. ini_set("display_errors", 1);
  4.  
  5. $con = mysqli_connect("localhost", "root", "", "kulturnik");
  6.  
  7. $name = $_POST["name"];
  8. $username = $_POST["username"];
  9. $password = $_POST["password"];
  10. $statement = mysqli_prepare($con, "INSERT INTO user (name, username, password) VALUES (?, ?, ?)");
  11. mysqli_stmt_bind_param($statement, "sss", $name, $username, $password);
  12.  
  13. mysqli_stmt_execute($statement);
  14.  
  15. $response = array();
  16. $response["success"] = true;
  17.  
  18. print_r(json_encode($response));
  19. ?>
Add Comment
Please, Sign In to add comment