I created a php file, order.php which is shown below
<?php
$plan=$_POST['plan'];
$expire= time()+60*60;
if (empty($plan))
{
echo '<p align="center">You did not select any plan.</p>';
}
else
{
$str1= "http://techbr.duoservers.com/hosting-order/?plan=";
$ur=$str1.$plan;
usleep(1500);
setcookie("ur", $ur, $expire);
header( 'Location: http://cheap-webhosting.co.in/signup.php') ;
}
?>
as you can see the script gets the value for the "plan" use that data to create a cookie ur which has the value say http://techbr.duoservers.com/hosting-order/?plan=44 where 44 is the plan value and then redirects to the page signup.php The code for signup.php is given below
<?php
$ur = $_COOKIE['ur'];
echo "<iframe frameborder='0'";
echo 'src="';
echo $ur;
echo '" width="100%" height="1100px"></iframe>';
?>
For some reason when i pass the order.php file a plan value a cookie is created but the signup.php which loads automatically due to the redirect command in the order.php is not able to read the cookie ur. However when i run a simple <?php
print_r($_COOKIE);
?>
the cookie ur's correct value is displayed. On top of that if i manually load signup.php the page is loading just fine. But it isn't able to read the cookie when it is loaded automatically by using a redirect command. Any idea what is wrong? I might add that the code used to work just fine some 1 month ago it stopped working all of a sudden