WOW lol. This seems pretty tricky. well here is my code
<?PHP session_start(); ?>
<?php if ($_POST['loginName'] != "" && $_POST['password'] !=""){?>
<?php require_once('Connections/ok.php');?>
<?php
mysql_select_db($database_ok,$ok);
$query = sprintf("SELECT firstName, loginName, passWord, USERID
FROM users
WHERE loginName = '%s'",mysql_real_escape_string($_POST['loginName']));
$results = mysql_query($query) or die("Query failed ($query): " . mysql_error());
$check = mysql_fetch_assoc($results);
if (strcasecmp($check['loginName'],$_POST['loginName']) == 0
&& strcmp($check['passWord'],$_POST['password']) == 0
&& !$check['passWord']== "" && !$check['loginName'] == "") {
$_SESSION['user'] = array('firstname'=>$check['firstName'],'userID'=>$check['USERID'],'loginName'=>$check['loginName']);
empty($_POST['loginName']); empty($_POST['passWord']);
mysql_close($ok);
header('location: http://localhost/admin.php');}
else { header('location: http://localhost/admin.php'); }?>
<?php }?>
how do you go about fixing this ??? So it works. Is there a better method for redirecting pages ?? should I put head(); function inside an include ?? or what??
cause i want it to check my syntax before it redirects the page