Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Apr 2005
    Thanked 0 Times in 0 Posts

    Passing *hidden* POST variables in a redirect?

    Let's say I want to have a user fill out a form on myserver.com, process it to check a few variables on myotherserver.com, add some variables to the mix, then submit the whole shebang to myserver.com again within a redirect, so it's like the user submitted the results of the script on myotherserver.com to a script on myserver.com.

    Now, I can do this where myotherserver.com puts up a page with the re-constituted form on it and asks them to click a button to finalize their submission, but that adds a step to the process for the user.

    I can do this using a Location: redirect, carpentering the vars onto the end of the URL (i.e. ("Location: http://myserver.com/process.php?var1=5&var2=7")) but I don't want the user to see some of the vars that were added and I want the vars available to the script on myserver.com as $_POST['var1'] and $_POST['var2'].

    Doing behind the scenes posting with fsckopen() or curl() doesn't work, because that posts the variables to myserver.com, but doesn't redirect the user to the output of the script on myserver.com. I could proxy the output from the second script back to the user, but they remain on myotherserver.com.

    So how do I do this? Is it even possible?

    - Greg

  • #2
    $object->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Jun 2003
    Thanked 23 Times in 23 Posts
    Well, I'm not the best person to ask the mechanics of how to do this, but is it possible to use sessions and cookies as a way of navigating between the sites with those variables?
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    SNAP to it!

  • #3
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Bradford, UK
    Thanked 66 Times in 65 Posts
    sessions wouldnt work because you're moving between 2 servers.
    The best way t do it would be to encrypt your querystring.


    Posting Permissions

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