Advertisement
Guest User

Untitled

a guest
Aug 13th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.70 KB | None | 0 0
  1. <html>
  2. <body bgcolor="#352000">
  3. <center>
  4. <?php
  5.  
  6. $host="pavo.volt-host.com";
  7. $username="1393_main";  
  8. $password="fatlard";
  9. $db_name="1393_main";
  10. $tbl_name="users";
  11.  
  12. mysql_connect("$host", "$username", "$password")or die("cannot connect");
  13. mysql_select_db("$db_name")or die("cannot select DB");
  14.  
  15. $myusername=$_POST['username'];
  16. $mypassword=$_POST['password'];
  17.  
  18. $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'";
  19. $result=mysql_query($sql);
  20.  
  21. $count=mysql_num_rows($result);
  22.  
  23. if($count==1){
  24.  
  25. session_register("username", $myusername);
  26. session_register("password", $mypassword);  
  27. echo "Welcome " .$_POST[username]. "!";
  28. }
  29. ?>
  30. </center>
  31. </body>
  32. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement