I have a form, depending on the selected value of my <select> box I would like to send to a different page.
I do not know the best way to do this, but I am thinking that maybe the best way is to have an intermediate page to always post to, then have the intermediate page check the value sent from the <select> box and forward the POST values to a different page depending on what it is. If this is the best way, how can I do that? If not, what is the best way?
Thanks!!
THat’s a good way. The alternative is to use Javascript to intercept the click, rewrite the
actionproperty of the form andsubmit()it.For your PHP though:
First page:
<form action="intermediary.php" method="post"> <input id="submitTo"> <select value="1">goToFirstPage</select> <select value="2">goToSecondPage</select> </input> </form>Second page:
Don’t put actual URLs in your first page, or you’ll run into massive security issues.