Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. <?
  2. //this pulls the variables from the flash movie when the user
  3. //hits submit. Use this when your global variables are off.
  4. //I don't know how to toggle global variables, so I just put
  5. //it in all the time ;)
  6. $user=$_POST['user'];
  7. $pass=$_POST['pass'];
  8.  
  9. //connect to database
  10. if ($user && $pass){
  11. mysql_pconnect("mysql6.000webhost.com","a7313820_prang","p1rate") or die ("didn't connect to mysql");
  12. mysql_select_db("a7313820_users") or die ("no database");
  13. //make query
  14. $query = "SELECT * FROM users WHERE username = '$user' AND password = '$pass'";
  15. $result = mysql_query( $query ) or die ("didn't query");
  16.  
  17. //see if there's an EXACT match
  18. $num = mysql_num_rows( $result );
  19. if ($num == 1){
  20. print "error=You're in&checklog=1";
  21. } else {
  22. print "error=Sorry, but your user name and password did not match a user name/password combination in our database. Usernames and passwords are entered in from a different file. Thank you for visiting test login script!!&checklog=2";
  23. }
  24. }
  25.  
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement