How could I redirect page through Isert PHP plugin?
-
Hi,
I am using Isert PHP plugin on my site https://tenants.cliffordsinclair.com.
I am trying to redirect to relevant page once the user selects both house id and year and then Submit the form. Here is complete code. Please help.
<div id="home-form"><form id="houses" class="house-select" method="post" name="houses" action="open-url()"> <div>Select your House ID from the list below <select name="house-id"> <option>RDG002</option> <option>RDG004</option> <option>RDG009</option> <option>RDG011</option> <option>RDG012</option> <option>RDG014</option> <option>RDG014A</option> <option>RDG017</option> <option>RDG046</option> <option>RDG050</option> <option>RDG058</option> <option>RDG086</option> <option>RDG097</option> <option>RDG110</option> <option>RDG279</option> </select></div> <div>Select your Tenancy Year <select id="student-year" name="student-year"> <option disabled="disabled"></option> <option>2015-16</option> </select></div> <input id="submit" name="submit" type="submit" value="Submit" /> </form></div> [insert_php] if(isset($_POST['submit'])) { $house = $_POST['house-id']; $year = $_POST['student-year']; $url = "https://tenants.cliffordsinclair.com/".$house."-".$year; } function open-url() { echo "<script type='text/javascript'>location.href='$url'</script>"; } if($_SERVER['REQUEST_METHOD']=='POST'){ open-url(); } [/insert_php]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How could I redirect page through Isert PHP plugin?’ is closed to new replies.