Page 1 of 1

page redirect

Posted: Wed Apr 09, 2003 1:37 am
by theclay7
I am trying to make a new post which requires user to login...just like the one used in here....

as you see, in the URL above, there is some value to pass "mode", "f" ....

how can I get these values again after redirect....

what I did is:

$q_id = $_REQUEST['q_id']; // just as $mode
$catID = $_REQUEST["catID"]; /// just as $f
$fromPage = "http://"
$fromPage .= $_SERVER[PHP_SELF];

if (!chkLogin) then
header ("Location: ".WWW_HTTPS_ROOT."zh_hk/main/prompt_login.php?fromPage=".$fromPage."?catID=".$catID."&q_id=".$q_id);

but then I only get $catID and NOT $q_id...
how can I get both value again....

Posted: Wed Apr 09, 2003 2:07 am
by bionicdonkey
all variable pass in the url can be retrieved using $_GET. i think there's a skicky about all that stuff

Posted: Wed Apr 09, 2003 2:16 am
by twigletmac
Try doing:

Code: Select all

echo '<pre>';
print_r($_GET);
echo '</pre>';
to see all of the variables from the URL.

You should be able to access the individual vars as:

Code: Select all

$q_id = $_GET['q_id']; 
$catID = $_GET["catID"];
if they've come out of a query string that looks something like:

Code: Select all

?q_id=something&amp;catID=something_else
Mac