Hello
I have written a login script for my system and used cookies in it, the cookie is set as a parameter of a header but each time I try to login in my browser I always get this error:
Warning: header() expects parameter 3 to be long, string given in d:\phpweb\xplosivehome.php on line 27
although the login works as I can login,but the error appears at the top of the page along with all the page's items
anyone knows how I can fic this, my script is below
<?php
//Create short variable names
$Email = $HTTP_POST_VARS['Email'];
$Password = $HTTP_POST_VARS['Password'];
//Check for required fields from login form
if (!$Email || !$Password){
header("Location: [url]http://82.44.148.126/login.html[/url]");
exit;
}
//Connect to mysql servers and select database
$session = mysql_connect("localhost", "root", "platinum")
or die(mysql_error());
mysql_select_db("xplosive") or die(mysql_error());
//issue query to mysql
$sql = "select First_name, Last_name
from customer_account
Where Email = '".$Email."' AND Password = '".$Password."'";
$result = mysql_query($sql,$session) or die(mysql_error());
//acquire number of rows in the result set
if (mysql_num_rows($result) == 1) {
//Set authorisation cookie
header ("Set-Cookie: auth", "1", "http://www.xplosivehome.php");
?>
thank you