Advertisement
Guest User

checklogin

a guest
Aug 19th, 2012
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. <?php
  2.  
  3. mysql_connect("localhost", "root", "mypassword")or die("cannot connect");
  4. mysql_select_db("lunch_punch")or die("cannot select DB");
  5.  
  6. $myname=$_POST['myname'];
  7.  
  8.  
  9. session_register("myname");
  10. header("location:login_success.php");
  11. }
  12. else {
  13. echo "Wrong Username or Password";
  14. }
  15.  
  16. <?php
  17. session_start();
  18. if(!session_is_registered(myname)){
  19. header("location:home.html");
  20. }
  21. ?>
  22.  
  23. <html>
  24. <body>
  25. Login Successful
  26. </body>
  27. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement