Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7

Thread: page redirect

  1. #1
    New Coder
    Join Date
    Feb 2003
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts

    page redirect

    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....

  • #2
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Just a note, you should be using the $_GET array for URL variables, not $_REQUEST.

  • #3
    New Coder
    Join Date
    Feb 2003
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i did try replacing by GET , but still I can only get the first variable $catID not the second...

  • #4
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I noticed you are using single quotes '' for the first variable, and double for the second.

    That could have something to do with it.

  • #5
    New Coder
    Join Date
    Feb 2003
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks for noticing and your help in this......

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

    hmm....it is weird eh!

  • #6
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #7
    Regular Coder
    Join Date
    Jun 2002
    Location
    Depends on the time of year
    Posts
    478
    Thanks
    0
    Thanked 0 Times in 0 Posts
    remove the underscore, see if that works, rename the variable in the URL without the underscore.

    Duniyadnd


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •