SHARE
TWEET

Untitled

a guest May 23rd, 2018 121 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $db_name = "ptgdatabase";
  3. $mysql_username = "root";
  4. $mysql_password = "";
  5. $server_name = "localhost";
  6. $conn = mysqli_connect($server_name, $mysql_username, $mysql_password, $db_name);
  7.  
  8. ?>
  9.  
  10.  
  11.  
  12. <?php
  13. require "conn.php";
  14. $user_name = $_POST["username"];
  15. $user_password = $_POST["password"];
  16.  
  17. $mysql_qry = "select * from Users where username like '$user_name' and password like '$user_password'";
  18. $result = mysqli_query($conn, $mysql_qry);
  19. if(mysqli_num_rows($result)>0){
  20.     echo "Login Successful";
  21. }
  22. else {
  23. echo "Login not Successful";
  24. }
  25. ?>
  26.  
  27.  
  28.  
  29.  
  30. <?php
  31. require "conn.php";
  32. $fullname = $_POST["fullname"];
  33. $email = $_POST["email"];
  34. $username = $_POST["username"];
  35. $password = $_POST["password"];
  36. $age = $_POST["age"];
  37. $gender = $_POST["gender"];
  38. $registeras = $_POST["registeras"];
  39.  
  40. //$hashedPassword = password_hash($password, PASSWORD_BCRYPT);
  41.  
  42. $mysql_qry = "insert into Users(fullname, email, username, password, age, gender, registeras) values
  43.    ('$fullname', '$email', '$username', '$password', '$age', '$gender', '$registeras')";
  44.  
  45. if($conn->query($mysql_qry) === TRUE){
  46.     echo "Data Inserted Successfully";
  47. }
  48. else {
  49. echo "Error: ".$mysql_qry. "<br>".$conn->error;;
  50. }
  51. $conn->close();
  52. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top