I want to make a form whose action is defined by one of the options in the form.
<form method="POST" action="../<?php echo $location?>.php">
<label>Post to: <select project="location" id="location" name="location">
<option value="null"></option>
<option value="$var1">Option1</option>
...
</select><br>
<input id ="button1" type="submit" name="submit" value="Post">
</form>
<?php $location = $_POST["location"]; ?>
It keeps using an empty value for location when the submit button is clicked; is there any way for it to store the value of $location before the form chooses where to post?
actionlive (without server reload) depending on a selected option. Sounds much more like a JavaScript question to me - do you have any experience in that field?