SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2002
    Location
    uk
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    resending $_post variables

    Hi
    I asked this in the javascript forum, but i think it may be able to be solved better with php.


    I have interrupted a login process (going to another interim page) to access the database and retrieve the zip code of the customer (don't ask :-). so they can agree or disagree (disagree is a javascript:back)

    there are 3 $_post variables which i need to send on to the script they should have gone to before my interuption!

    At the moment i am trying it from within a confirm() to the login script.

    Can this be done? They have to be $_post, rather than $_get

    Is there a php alternative to the confirm?

    I am not a programmer, so apologise if what i am asking is stupid.

    Thanks in advance


    Paul

  2. #2
    SitePoint Wizard bronze trophy bigalreturns's Avatar
    Join Date
    Mar 2006
    Location
    The Wirral, England
    Posts
    1,294
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if i understand you correctly, then i think sessions would be the best idea for you to use. this stores values securely on the server, for retrieval later. Each user is givven a unique sessions id, which identifies which set of values on the server "belong" to them. So if u store what the user has entered in the form in a sessions variable, then u can redirect him to ur zipcode page ,then when he comes back retrieve the values from the session. Does this sound like it would fit your need? if so then ill be happy to post some code for how to use sessions (or see if someone better than me would!)
    Alex
    "The proper function of man is to live - not to exist."
    Get a Free TomTom


  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2002
    Location
    uk
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Alex
    Thanks for the quick reply and offer, but i cannot set any sessions yet.

    The $_post variabls are normally sent to a script that sets all the sessions and logs the user in. Although i am learning, i don't/can't want to change this script. I am interrupting the journey to this script purely to acces the zip code. Then, once the customer has agreed that this is their Zip i want the $_post variables to the script they should have gone to and then let THAT script set the sessions after it has checked the $_post variables.

    Even if i can somehow send the $_post variables (of which are now known) through to the script as their 'real' values it would be fine, but i lack so much knowledge....


    If it is getting complicated, apologies!

    Paul

  4. #4
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also answered in the javascript forum. If you are going to double post, say so in your original post.

    Hi Alex
    Thanks for the quick reply and offer, but i cannot set any sessions yet.
    Are you able to do this yet?
    Code:
    $myArray = array();
    $myArray['name'] = 'jim';
    echo $myArray['name'];
    If you are, you can do sessions. Read the reply in the js forum and see if that helps.

  5. #5
    SitePoint Enthusiast
    Join Date
    Dec 2002
    Location
    uk
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would have done, but i didn't think of the php forum until afterwards. I wouldn't double post normally.

  6. #6
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i want the $_post variables to the script they should have gone to and then let THAT script set the sessions after it has checked the $_post variables.
    What you want and the way things work don't mesh. Variables from a form are only available to the page listed in the action attribute of the form--that's your interim page. No page after that gets those values. You have options to preserve those values: sessions, query strings, cookies, or hidden form fields. Choose your poison.

  7. #7
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would have done, but i didn't think of the php forum until afterwards. I wouldn't double post normally.
    All you have to do is post a note after your original post saying that you have decided to seek advice elsewhere, and then the people in the original forum won't waste their time answering.


Bookmarks

Posting Permissions

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