![]() |
|
|
#1
|
||||
|
||||
|
$_POST variables help please
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 |
|
#2
|
|||
|
|||
|
Maybe i didn't understand the question properly, but you can put those discount codes in $_SESSION variable or in a cookie.
|
|
#3
|
||||
|
||||
|
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?
|
|
#4
|
||||
|
||||
|
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> ?>
__________________
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning. |
|
#5
|
|||
|
|||
|
If you need to repost variables I suggest to make them hidden fields on the form. <input type="hidden"> and so on.
|
|
#6
|
|||
|
|||
|
As i understood your question: To get all posted data you can use foreach method like this
foreach($_POST as $v){ echo $v; } Last edited by quicksolutions; Feb 29th 2008 at 6:39 am. |
![]() |
| Bookmarks |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| $_POST[op] | lektrikpuke | PHP | 7 | Oct 22nd 2007 12:36 pm |
| unsetting $_POST variables even if "Refreshed" | jasonjohnson3424 | PHP | 7 | May 18th 2007 8:56 am |
| How to use $_post with js?? | 123GoToAndPlay | JavaScript | 3 | May 12th 2007 10:12 am |
| $_POST method help | Vizuke | PHP | 5 | Sep 4th 2006 11:05 am |
| $_POST problem | mnemtsas | PHP | 6 | Oct 24th 2005 1:59 pm |