danhere Posted June 26, 2008 Share Posted June 26, 2008 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 ? Quote Link to comment https://forums.phpfreaks.com/topic/112036-post-and-global-variables/ Share on other sites More sharing options...
.josh Posted June 26, 2008 Share Posted June 26, 2008 You can keep passing them through hidden vars in your next form if you want, or look into making them session vars. Quote Link to comment https://forums.phpfreaks.com/topic/112036-post-and-global-variables/#findComment-575082 Share on other sites More sharing options...
rhodesa Posted June 26, 2008 Share Posted June 26, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/112036-post-and-global-variables/#findComment-575084 Share on other sites More sharing options...
danhere Posted June 26, 2008 Author Share Posted June 26, 2008 Great. Thanks for both of your help. Much appreciated. I'll let you know how it goes. -Dan Quote Link to comment https://forums.phpfreaks.com/topic/112036-post-and-global-variables/#findComment-575087 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.