I am attempting to create 2 cookies in php, but I keep having problems.
Here is where I send the information out to create the cookie:
Here is the coding for the redir() function:
and here is the code of the setcookie.php file:
$USERNAME and $MEMBERLEVEL ARE filled with the correct info before being sent to the setcookie.php file. I even see the information in the URL, but for some reason, the cookies are not being set, before the page is redirected.
What am I doing wrong? I have used this exact same process in the past for other sites, but I just cant figure this one out.
Here is where I send the information out to create the cookie:
Code:
redir("[URL unfurl="true"]http://*****cat-ox.com/BMW/includes/setcookie.php?name=$USERNAME&group=$MEMBERLEVEL","Just[/URL] a moment while you are redirected to the BMW Toolbox.");
Here is the coding for the redir() function:
Code:
function redir($target,$msg) {
global $background,$font_face,$title_color;
?>
<head>
<link rel="stylesheet" type="text/css" href="[URL unfurl="true"]http://www.*****cat-ox.com/BMW/battleboards/css/BMW.css"[/URL] />
<meta http-equiv="refresh" content="1; url=<?=$target?>">
</head>
<body>
<center>
<table width="451" height "1500" cellpadding="0" cellspacing="0" border ="0" id="header">
<tr>
<td width="451" height="243">
<center>
<h1 style="font-family:vivaldi;font-size:300%">Beta's Most Wanted</h1>
</center>
</td>
</tr>
</table>
<h3>
<?=$msg?>
</h3>
<br>
Please wait...
</center>
</body>
<?
exit;
}
?>
and here is the code of the setcookie.php file:
Code:
<?
<?
$UNAME=$name;
$ULEVEL=$group;
setcookie("BMWmember", $UNAME, time()+36000, "/");
setcookie("BMWmemberlvl", $ULEVEL, time()+36000, "/");
header("Location: [URL unfurl="true"]http://www.*****cat-ox.com/BMW/battleboards/");[/URL]
exit;
?>
$USERNAME and $MEMBERLEVEL ARE filled with the correct info before being sent to the setcookie.php file. I even see the information in the URL, but for some reason, the cookies are not being set, before the page is redirected.
What am I doing wrong? I have used this exact same process in the past for other sites, but I just cant figure this one out.