Jump to content

Recommended Posts

I have a form and the variables are you know $_POST[variables] and stuff. I need them to be echoed some where else in another step through another form. So if you click "submit" they all echo on the next page so the user can check there data. Then it asks to complete so then it goes through again. Should they stay the same? Like can I just call them as $_POST variables or do I need to change the POST variables to GLOBAL variables? Or something else I'm not getting?

I have :

$cosign = $_POST[cosign]; 
$coadd = $_POST[coadd];
$cocity = $_POST[cocity];
$costate = $_POST[costate];

 

Now should I change those variables like I did to GLOBALS? Or can they stay that way or ?

Link to comment
https://forums.phpfreaks.com/topic/112036-post-and-global-variables/
Share on other sites

beat me to it...but here is my 2 cents still:

 

GLOBAL variables won't carry from page to page. they disappear after the script finishes generating a page.

 

there are two options:

-the most common is to use a SESSION and store the values in there. http://us2.php.net/manual/en/session.examples.php

-the other is to have another form on the second page, and put all the values as hidden input elements. then, when they click FINISH on the second page, it submits the form to the third page

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.