Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ob_start();
- include("config.php");
- $link = mysql_connect($server, $db_user, $db_pass)
- or die ("Could not connect to mysql because ".mysql_error());
- mysql_select_db($database)
- or die ("Could not select database because ".mysql_error());
- $match = "select id from $table where username = '".$_POST['username']."' and password = md5('".$_POST['password']."');";
- $qry = mysql_query($match)
- or die ("Could not match data because ".mysql_error());
- $num_rows = mysql_num_rows($qry);
- if ($num_rows <= 0) {
- include('404.php');
- exit;
- } else {
- setcookie("loggedin", "".$_POST['username']."", time()+(3600 * 24));
- include('modules/index.php');
- }
- ob_end_flush();
- ?>
Add Comment
Please, Sign In to add comment