Advertisement
Guest User

Untitled

a guest
Feb 12th, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. <?php
  2. define('DBUSER', 'id650955_gokulm100');
  3. define('DBPASS', 'gokulm100');
  4. define('DBHOST', 'localhost');
  5. define('DBNAME', 'id650955_harry');
  6.  
  7. $conn = new mysqli(DBHOST, DBUSER, DBPASS, DBNAME);
  8.  
  9. if (!$conn) {
  10. die('error connecting to database');
  11. }
  12.  
  13. echo 'you have created case';
  14.  
  15.  
  16. if(isset($_POST["username"]) && isset($_POST["email"]) && isset($_POST["phone"]) && isset($_POST["password"]))
  17. {
  18.  
  19.  
  20. $username = $_POST["username"];
  21.  
  22.  
  23. $email = $_POST["email"];
  24.  
  25.  
  26. $phone = $_POST["phone"];
  27.  
  28.  
  29. $password = $_POST["password"];
  30.  
  31.  
  32.  
  33. $statement = mysqli_prepare($conn, "INSERT INTO harry (username, email, phone, password) VALUES (?, ?, ?, ?)");
  34.  
  35.  
  36. mysqli_stmt_bind_param($statement, "ssis", $username, $email, $phone, $password);
  37.  
  38.  
  39. mysqli_stmt_execute($statement);
  40.  
  41.  
  42. $response = array();
  43.  
  44.  
  45. $response["success"] = 1;
  46.  
  47. echo json_encode($response);
  48. }
  49.  
  50. else{
  51.  
  52. echo "not set";
  53.  
  54. }
  55.  
  56.  
  57.  
  58. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement