I spent another 2 days trying to sort it out but couldn't get it to work. All I am attempting to do is pass a cookie to the originating page with register_globals Off. I have shortened the code and implemented the suggestions but to no avail. Any help is appreciated. reg_globals=On it works, reg_globals-Off doesn't work. I have no more hair to fall out...........Anyone out there that can make it work?
<?php
if(!isset($GET['COOKIE_SET'] ))
{
setcookie("whichPage","$page");
header ("Location:".$SERVER['PHP_SELF']."?COOKIE_SET=1");
}
?>
<html>
<head>
<title>CookieWorks with RG Off</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<p>Testpage for index.php r_g = Off</p>
<p><a href="cookieone.php?page=one">Link 1</a></p>
<p>Cookies = <?php print_r ($_COOKIE); ?></p>
<p>whichPage = <?php print ($page); ?></p>
</body>
</html>