javascript - Post data to one page but navigate to another -
this question has answer here:
- how make redirect in php? 21 answers
i have drop down box user selects value. want post value map.php used. have form posting map.php fine - however, want navigate index.php after user has made selection , clicked button, rather navigating map.php. have looked solution this, appear situations visiting page data posted to...
userinterface.php
<form name="formname" method="post" action="map.php"> <div id='userlist'> <?php //get constants database require("database.php"); // opens connection mysql server $connection = mysqli_connect ($server, $username, $password); $query = "select distinct user route"; $result = mysqli_query($connection, $query); echo '<select name="dropdown" style="width:400px;">'; $count = 1; while($r = mysqli_fetch_assoc($result)){ echo "<option value =".$count.">".$r['user']."</option>"; $count++; } echo '</select>'; ?> <input type="submit" id="button" value="get started!" /> map.php
$value = $_post['dropdown']; if($value==1){....
just use header :
header('location: http://www.example.com/'); based on php docs : http://php.net/manual/en/function.header.php
Comments
Post a Comment