javascript - Post data to one page but navigate to another -


this question has answer here:

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

Popular posts from this blog

1111. appearing after print sequence - php -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -