I have read this on php.net
The manual states that "cookies will not become visible until the next loading of a page that the cookie should be visible for", but there's a way around this that doesn't require a refresh. Just set the $_COOKIE variable right after you setcookie().
$lang = 'pt-br';
setcookie('lang', $lang);
$_COOKIE['lang'] = $lang;
The reason for this is that $_COOKIE is automatically set only when the page loads, but setting it explicitely makes the new cookie value available globally even for the same page that created it.
ok that made sence
so I made
<?
$user = $GET['userid'];
$pass = $GET['pass'];
include("connect.php");
$sql2 = "SELECT password FROM table WHERE email='$email'";
$ExecuteQuery2 = mysql_query($sql2);
$getit = mysql_fetch_array($ExecuteQuery2,MYSQL_ASSOC);
$userid = $getit['email'];
$password = $getit['password'];
if ($userid == $user && $password==$pass)
{
mysql_close($db_conn);
$login ="$user:$pass";
setcookie("FREEcam","$user:$pass",time()+4200,"/members/","www.freecamshow.com","0");
$_COOKIE['FREEcam'] = $login;
header("Location: http://www.url.com/members/index.php");
exit;
}
else
{
header("Location: http://www.Url.com/joinus.html");
}
?>
I'm still getting the popup login box. Any clues?
lilRachie