EDIT: have fixed my own problem. sorry.
Hello
I would like to know how to pass on a variable after a person submits a form, so that I can use a "switch" command in the page.
For example, what I do with my webpages is have each URL called <a href="index.php?load=contactme"> or <a href="index.php?load=homepage"> and the index.php page has a switch command saying to get the load variable and then to include a specific bit of text.
This works perfectly for all URLs.
However, I want to do exactly the same thing when someone fills in a form and presses "submit", but I can't figure out what to do.
I have my form:
PHP Code:
<form action="index.php" method="post">
<input type="text" name="test_text" length="30">
<input type="submit" name="submit" value="submit!">
</form>
and when the person presses submit want it to go to the index.php page and load a certain include. For example, one saying "Thanks for submitting."
In there anyway to pass a variable on the URL after pressing submit? For example, using a hidden field in the form? I tried index.php?load=thanks, but I don't remember it working.
Thanks in advance for you help.
Hamish
EDIT: for some reason action="index.php?load=thanks" is now working. Sorry to have bothered anyone.
Last edited by hamish : 11-12-2004 at 12:40 PM.
|