View Full Version : $_POST variables help please
gordi555
Feb 29th 2008, 3:19 am
I have a page which get's it values from a POST method.
Basically...
I want to allow people entering discount codes and then repost all the post varibles to the current page again so I can process any codes that where added.
Does anyone know a quick solution to this please?
Thanks for all your help,
Gordon
AsHinE
Feb 29th 2008, 3:29 am
Maybe i didn't understand the question properly, but you can put those discount codes in $_SESSION variable or in a cookie.
gordi555
Feb 29th 2008, 4:07 am
Yes I'm storing discount in a session but I was wondering how can I easily re-post all the $_POST variables without to the page again?
bartolay13
Feb 29th 2008, 5:39 am
you can store it into cookies,session, global and or to the db.
or send it to the same page..
<?php
if(isset($_POST['yourform']))
{
echo "<form name="form2">";
...........
echo "</form>";
}
<form name="yourform">
............
</form>
?>
AsHinE
Feb 29th 2008, 6:07 am
Yes I'm storing discount in a session but I was wondering how can I easily re-post all the $_POST variables without to the page again?
If you need to repost variables I suggest to make them hidden fields on the form. <input type="hidden"> and so on.
quicksolutions
Feb 29th 2008, 6:29 am
As i understood your question: To get all posted data you can use foreach method like this
foreach($_POST as $v){
echo $v;
}
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.