Guest User

Untitled

a guest
Mar 7th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <?php
  2. ob_start();
  3. include("config.php");
  4. $link = mysql_connect($server, $db_user, $db_pass)
  5. or die ("Could not connect to mysql because ".mysql_error());
  6. mysql_select_db($database)
  7. or die ("Could not select database because ".mysql_error());
  8. $match = "select id from $table where username = '".$_POST['username']."' and password = md5('".$_POST['password']."');";
  9. $qry = mysql_query($match)
  10. or die ("Could not match data because ".mysql_error());
  11. $num_rows = mysql_num_rows($qry);
  12. if ($num_rows <= 0) {
  13. include('404.php');
  14. exit;
  15. } else {
  16. setcookie("loggedin", "".$_POST['username']."", time()+(3600 * 24));
  17. include('modules/index.php');
  18. }
  19. ob_end_flush();
  20. ?>
Add Comment
Please, Sign In to add comment