Redirect to other page by dropdown list :
Step 1: Write down the bit of php code
<?php
if (isset($_POST[‘nav’])) {
header(“Location: $_POST[nav]”);
}
?>
Step 2: javascript code
<script type=”text/javascript”>
$(function() {
$(“#submit”).hide();
$(“#page-changer select”).change(function() {
window.location = $(“#page-changer select option:selected”).val();
})
});
</script>
Step 3: Make Html form & fields
<form name=”form1″ id=”page-changer” action=”” method=”post”>
<div align=”center”><strong>Select Your Option </strong>
<select name=”nav”>
<option value=””>Select Your Option…</option>
<option value=”paidstp.php”>All Paid Students</option>
<option value=”paidlocation.php”>Search Date & Location Wise</option>
</select>
<input type=”submit” value=”Go” id=”submit” />
</div>
</form>
No comments:
Post a Comment