how to capture data from variable after redirect to another page

Reply

Join Date: Oct 2005
Posts: 36
Reputation: tirivamwe is an unknown quantity at this point 
Solved Threads: 2
tirivamwe's Avatar
tirivamwe tirivamwe is offline Offline
Light Poster

how to capture data from variable after redirect to another page

 
0
  #1
Sep 12th, 2007
code in login page is:

  1. header("Location: index.php?$page");

how do i get the data from the variable in index page after redirect from login page
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,515
Reputation: Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future 
Solved Threads: 523
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster

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

 
0
  #2
Sep 12th, 2007
Originally Posted by tirivamwe View Post
code in login page is:

  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.
Reply With Quote Quick reply to this message  
Join Date: Oct 2005
Posts: 36
Reputation: tirivamwe is an unknown quantity at this point 
Solved Threads: 2
tirivamwe's Avatar
tirivamwe tirivamwe is offline Offline
Light Poster

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

 
0
  #3
Sep 14th, 2007
there is this code
  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
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,515
Reputation: Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future Ezzaral has a brilliant future 
Solved Threads: 523
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster

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

 
0
  #4
Sep 14th, 2007
Originally Posted by tirivamwe View Post
there is this code
  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:
  1. header("Location: index.php?var1=$var1");
In your index page, you retrieve it from the request like this
  1. $var1 = $_GET['var1'];
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 5574 | Replies: 3
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC