mysql - Display output result in another page in PHP -


i have tour search application user can search available tours based on 3 different parameters- region, country , duration. code using showing output result in same page. want output result show in different page.

database structure

below php code:

<?php       mysql_connect("localhost", "root", "");     mysql_select_db("byp");      if(isset($_post['submit'])){         $region=$_post['region'];         $country=$_post['country'];         $duration=$_post['duration'];          //define index option         $optionallvalue = 0; //add here option index value used 'all' option         //define clause query         //in order avoid many conditions verifications, start 1=1         $whereclause = "1=1";          //now check if option selected each field not value defined option 'all'         //this example, , best create function avoid replication of code          if($region != $optionallvalue)         {             $whereclause = $whereclause." , region='$region'";         }         if($country != $optionallvalue)         {             $whereclause = $whereclause." , country='$country'";         }         if($duration != $optionallvalue)         {             $whereclause = $whereclause." , duration='$duration'";         }          $query = "select * byp_tour ".$whereclause;          //original query select * byp_tour region='$region' , country='$country' , duration='$duration'"         $tour = mysql_query($query);         $tournum = mysql_num_rows($tour);          if($tournum >0){              while($result=mysql_fetch_array($tour)){                  $tour_name = $result['tour_name'];                 $tour_detail = $result['tour_detail'];                  echo "tour name: $tour_name";  // here output result                 echo "<br />";                 echo "tour detail: $tour_detail";                 echo "<br />";                 echo "<br />";                 echo "<br />";             }         }         else{             echo "no tour found";             echo "<br />";             echo "<br />";         }     } ?> <!doctype html> <html>     <head>         <title>byp test</title>     </head>     <body>         <form action="searchtest.php" method="post">             <div>                 <label>region</label>                 <select id="region" name="region">                     <option value="0">all</option>                     <option value="1">south east asia</option>                     <option value="2">africa</option>                     <option value="3">europe</option>                     <option value="4">america</option>                     <option value="5">australia</option>                                                </select>             </div>             <div>                 <label>country</label>                 <select id="country" name="country">                 <option value="0">all</option>                 <option value="1">cambodia</option>                 <option value="2">thailand</option>                 <option value="3">vietnam</option>                 <option value="4">myanmar</option>                 <option value="5">laos</option>                 <option value="6">ethiopia</option>                 <option value="7">france</option>                 <option value="8">new york city</option>                 <option value="9">melbourne</option>             </select>         </div>         <div>             <label>duration</label>             <select id="duration" name="duration">                 <option value="0">all</option>                 <option value="1">5 days</option>                 <option value="2">10 days</option>             </select>         </div>         <input type="submit" name="submit" value="submit" />         </form>     </body> </html> 

you need add target="_blank" <form>:

<form action="searchtest.php" method="post" target="_blank"> 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -