User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,468 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,813 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 2990 | Replies: 3
Reply
Join Date: Oct 2005
Location: Harare, Zimbabwe
Posts: 34
Reputation: tirivamwe is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 2
tirivamwe's Avatar
tirivamwe tirivamwe is offline Offline
Light Poster

how to capture data from variable after redirect to another page

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

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

how do i get the data from the variable in index page after redirect from login page
AddThis Social Bookmark Button
Reply With Quote  
Join Date: May 2007
Location: USA
Posts: 3,090
Reputation: Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold 
Rep Power: 15
Solved Threads: 307
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Posting Sensei

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

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

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  
Join Date: Oct 2005
Location: Harare, Zimbabwe
Posts: 34
Reputation: tirivamwe is an unknown quantity at this point 
Rep Power: 4
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

  #3  
Sep 14th, 2007
there is this code
$var1='done'
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  
Join Date: May 2007
Location: USA
Posts: 3,090
Reputation: Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold 
Rep Power: 15
Solved Threads: 307
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Posting Sensei

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

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

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 2:25 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC