943,954 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 9614
  • PHP RSS
Sep 12th, 2007
0

how to capture data from variable after redirect to another page

Expand Post »
code in login page is:

PHP Syntax (Toggle Plain Text)
  1. header("Location: index.php?$page");

how do i get the data from the variable in index page after redirect from login page
Similar Threads
Reputation Points: 11
Solved Threads: 2
Light Poster
tirivamwe is offline Offline
36 posts
since Oct 2005
Sep 12th, 2007
0

Re: how to capture data from variable after redirect to another page

Click to Expand / Collapse  Quote originally posted by tirivamwe ...
code in login page is:

PHP Syntax (Toggle Plain Text)
  1. header("Location: index.php?$page");
how do i get the data from the variable in index page after redirect from login page
You mean the $page value? Or some other variable? If you mean $page (which I assume is a name-value pair like "var=someValue", if not then you aren't sending it correctly) then in index.php you can read it from the request as $var=$_GET['var'];
If this is not what you are asking about, please reply with a little bit more detail on the question.
Moderator
Featured Poster
Reputation Points: 3239
Solved Threads: 839
Posting Genius
Ezzaral is offline Offline
6,761 posts
since May 2007
Sep 14th, 2007
0

Re: how to capture data from variable after redirect to another page

there is this code
PHP Syntax (Toggle Plain Text)
  1. $var1='done'
  2. header("Location: index.php?$var1");

and now want to pass the value in the variable $var1 and store it in another variable in index page
Reputation Points: 11
Solved Threads: 2
Light Poster
tirivamwe is offline Offline
36 posts
since Oct 2005
Sep 14th, 2007
0

Re: how to capture data from variable after redirect to another page

Click to Expand / Collapse  Quote originally posted by tirivamwe ...
there is this code
PHP Syntax (Toggle Plain Text)
  1. $var1='done'
  2. header("Location: index.php?$var1");
and now want to pass the value in the variable $var1 and store it in another variable in index page
Ok, to do that you will need to change your redirect url a little bit. Variables are passed with a name and a value, so you would send it like so:
PHP Syntax (Toggle Plain Text)
  1. header("Location: index.php?var1=$var1");
In your index page, you retrieve it from the request like this
PHP Syntax (Toggle Plain Text)
  1. $var1 = $_GET['var1'];
Moderator
Featured Poster
Reputation Points: 3239
Solved Threads: 839
Posting Genius
Ezzaral is offline Offline
6,761 posts
since May 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Parse error, unexpected T_STRING, expecting T_CASE
Next Thread in PHP Forum Timeline: Upload----Phpbb3?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC