0

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

2
Contributors
3
Replies
12
Views
10 Years
Discussion Span
Last Post by Ezzaral
0

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.

0

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

0

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'];
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.