Advertisement
Guest User

Untitled

a guest
Aug 14th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1. <html>
  2. <body bgcolor="white">
  3. <center>
  4. <?php
  5.  
  6. $host="pavo.volt-host.com";
  7. $username="********";  
  8. $password="********";
  9. $dbname="1393_main";
  10. $tblname="names";
  11.  
  12. mysql_connect("$host", "$username", "$password")or die("cannot connect");
  13. mysql_select_db("$dbname")or die("cannot select DB");
  14.  
  15. $myusername=$_POST['Username'];
  16. $mypassword=$_POST['Password'];
  17.  
  18. $sqll="SELECT * FROM $tblname WHERE username='$myusername' and password='$mypassword'";
  19. $result=mysql_query($sqll);
  20.  
  21. $count=mysql_num_rows($result);
  22.  
  23. if($count==1){
  24.  
  25. session_login("username", $myusername);
  26. session_login("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