View Full Version : page redirect

04-09-2003, 08:34 AM
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 "action", "s" ....

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

what I did is:

$q_id = $_REQUEST['q_id']; // just as $action
$catID = $_REQUEST["catID"]; /// just as $s
$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....

04-09-2003, 08:38 AM
Just a note, you should be using the $_GET array for URL variables, not $_REQUEST.

04-09-2003, 08:49 AM
i did try replacing by GET , but still I can only get the first variable $catID not the second...

04-09-2003, 05:46 PM
I noticed you are using single quotes '' for the first variable, and double for the second.

That could have something to do with it.

04-10-2003, 03:39 AM
thanks for noticing and your help in this......

I tried to change the quote and still not working....

hmm....it is weird eh!

04-10-2003, 08:27 AM
That is weird.

If you haven't already, try re-writing the code without looking at the current code. I do that sometimes, sometimes you fix your error without knowing it.

04-10-2003, 08:48 PM
remove the underscore, see if that works, rename the variable in the URL without the underscore.