Guest User

Untitled

a guest
Sep 18th, 2017
23
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. $servername = "localhost";
  3. $username = "scse";
  4. $password = "scse";
  5. $dbname = "scse";
  6.  
  7. // Create connection
  8. $conn = mysqli_connect($servername, $username, $password, $dbname);
  9. // Check connection
  10. if (!$conn) {
  11. die("Connection failed: " . mysqli_connect_error());
  12. }
  13.  
  14. $sql = "INSERT INTO bce0617 (username, password, phone)
  15. VALUES ('".$_POST["username"]."','".md5($_POST["password"])."','".$_POST["phone"]."')";
  16.  
  17. if (mysqli_query($conn, $sql)) {
  18. echo "Registered successfully";
  19. } else {
  20. echo "Error: " . $sql . "<br>" . mysqli_error($conn);
  21. }
  22.  
  23. mysql
Add Comment
Please, Sign In to add comment