Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8732367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:25:39+00:00 2026-06-13T09:25:39+00:00

I created a php file, order.php which is shown below <?php $plan=$_POST[‘plan’]; $expire= time()+60*60;

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T09:25:40+00:00Added an answer on June 13, 2026 at 9:25 am

    You can’t read a cookie that has been created for an other url/path :

    You created your cookie only for the directory http://techbr.duoservers.com/hosting-order/ (because you omited the 4th parameter path of the set_cookie function, php choose the current directory, see quote below)

    and try to access it in another one : http://cheap-webhosting.co.in/

    You can’t do that.. You’ll have to force the cookie path parameter to "/" for example.

    See the php doc :

    path:

    The path on the server in which the cookie will be available on. If
    set to ‘/’, the cookie will be available within the entire domain. If
    set to ‘/foo/’, the cookie will only be available within the /foo/
    directory and all sub-directories such as /foo/bar/ of domain. The
    default value is the current directory that the cookie is being set
    in.

    source: http://php.net/manual/en/function.setcookie.php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created PHP GD image for captcha, file called image.php each time it
I created a php file that parses a .txt file to display real estate
I created a php file to return data encoded with JSON and then used
How to manually create Friendly URLs? (PHP) So I have created simple php file
I created an error500.php file in web/errors/ and would now like to test it.
I created a jQuery function that calls on a PHP server-side file that pulls
I created a file download script in PHP, it works, but web browsers report
Hi I created two file to switch my forum (Language Chinese and English) enForum.php
I have a filelist.txt file and I created a file called clear.php to clear
I have created a shortcode in my functions.php which is designed to return the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.