Advertisement
Guest User

Untitled

a guest
Oct 11th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. <?php
  2.  
  3. $host="l888888"; // Host name
  4. $username="******"; // Mysql username
  5. $password="t******"; // Mysql password
  6. $db_name="f****"; // Database name
  7. $tbl_name="m******"; // Table name
  8.  
  9. // Connect to server and select databse.
  10. mysql_connect("$host", "$username", "$password")or die("cannot connect");
  11. mysql_select_db("$db_name")or die("cannot select DB");
  12.  
  13. // username and password sent from form
  14. $myusername=$_POST['username'];
  15. mypassword=$_POST['password'];
  16.  
  17.  
  18. // To protect MySQL injection (more detail about MySQL injection)
  19. $myusername = stripslashes($myusername);
  20. $mypassword = stripslashes($mypassword);
  21. $myusername = mysql_real_escape_string($myusername);
  22. $mypassword = mysql_real_escape_string($mypassword);
  23.  
  24. $query=mysql_query("INSERT INTO members(`username`,`password`) VALUES ('$myusername','$mypassword')");
  25.  
  26.  
  27. if($query)
  28. header('Location: /home/faltutal/public_html/treasurehunt/index.php');
  29.  
  30. <?php
  31. $query=mysql_query("INSERT INTO members(`username`,`password`)
  32. VALUES('$myusername','$mypassword')");
  33. if($query)
  34. header('Location: http://my_ip/index.php.php?msg=added successfully');
  35. ?>
  36.  
  37. <?php
  38. $query=mysql_query("INSERT INTO members(`username`,`password`)
  39. VALUES('$myusername','$mypassword')");
  40. if($query)
  41. echo "Successfully Added <a href='http://my_ip/index.php'>Click Here to Continue</a>";
  42. ?>
  43.  
  44. <?php
  45. $query=mysql_query("INSERT INTO members(`username`,`password`)
  46. VALUES('$myusername','$mypassword')");
  47. if($query)
  48. header('Location: http://my_ip/mainpage.php.php');
  49. ?>
  50.  
  51. if ($query) { // if it's true
  52. header('Location: http://yoursite.com/index.php');
  53. }
  54.  
  55. <?php ob_start();
  56. $query=mysql_query("INSERT INTO members(`username`,`password`)
  57. VALUES('$myusername','$mypassword')");
  58. if($query)
  59. header('Location: http://my_ip/index.php.php?msg=added successfully');
  60.  
  61. ob_end_flush(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement