2014-11-05 45 views
-1

嗨我想提出一個網頁航空訂票爲我的項目,並在主頁上我一直幾個文本框,當我打提交按鈕,它會顯示這已經是在頁面上表中的數據..而是我想在一個彈出屏幕顯示整個表..所以當我點擊搜索按鈕,它應搜索數據庫並顯示到可用的航班在一張表上彈出一個框...Java代碼或PHP代碼到一個警告彈出框在HTML網頁顯示整個數據庫

這是數據在頁面上顯示的基本代碼..我想改變這個顯示它在一個java或php彈出框可能有一些設計看起來有點吸引力.. plz幫助

<?php 
include ('airlineDB2.php'); 
    ?> 
    <html> 
    <head> 

    <link rel="stylesheet" type="text/css" href="style.css"></link> 

</head> 
<body> 
<form action="" name="formdownload" method="post"> 
    <center> 
     <div class="page"> 
         <div class="header"> 
          <div class="logo"> 
          <img src="bankimg.jpg"> 

    <div class="bnkname"> 
    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<h1><font color="blue" size="10" font face="Lucida Handwriting">AIRINDIA Airline Reservation</font></h1> 
</div> 


<div class="linkspart"> 

    <div class="sublinks"> 
    <a href="airline.php">Home </a>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp 
    <a href="search.php">Search Flight</a>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp 

<a href="about.php">About us</a>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp 

<a href="help.php">Help/FAQ</a>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp 

    </div> 
    </div> 


    <div class="bodypart"> 
<div class="regi"> 
<table> 
    <tr><td colspan=2><h1>Domestic Flights</h1></td></tr></br> 
     <td height=50> From:</td><td><input type="From" name="from" size=30/> 
     <tr><td height=50>To: </td><td><input type="To" name="to" size=30/> 
     <tr><td><input name="submit" type="submit" value ="Search"></tr></td> 
     <table border="1" align="center" id="table1" cellpadding="0" cellspacing="0"> 
      <tr> 
       <th>Flight No</th> 
       <th>Flight Company</th> 
       <th>Plane Type</th> 
       <th>From</th> 
       <th>To</th> 
      </tr> 
      <center> 

      <?php 

      $submit = @$_POST['submit']; 
      $from = @$_POST['from']; 
      $to = @$_POST['to']; 
      if($submit) 
      { 
       if($from==true) 
       { 
       $select=mysql_query("select * from flight where ffrom='$from' and tto='$to'"); 
       while($row1=mysql_fetch_array($select)) 

       { 
        $FlightNo = $row1['flightno']; 
        $FlightCompany=$row1['flightcompany']; 
        $PlaneType = $row1['planetype']; 
        $From =$row1['ffrom']; 
        $To =$row1['tto']; 

      ?> 


      <tr> 

      <td width="90" align="center"> 
       <?php echo $FlightNo;?> 
      </td> 
      <td width="90" align="center"> 
       <?php echo $FlightCompany;?> 
      </td> 
      <td width="90" align="center"> 
       <?php echo $PlaneType;?> 
      </td> 
      <td width="90" align="center"> 
       <?php echo $From;?> 
      </td> 
      <td width="90" align="center"> 
       <?php echo $To;?> 
      </td> 

      </tr> 
      <?php } 

      echo"enter a place to go:";}}?> 
      </table> 

    </table> 
</form> 
</div> 
</div> 
</div> 


</div> 

</center> 

</body> 
</html> 

回答

0

如果我理解你的權利,你想在一個彈出此頁面?所以,你可以使用:

<iframe src=''> <iframe>

你需要把這個你想要的其他頁面,彈出頁面。您現在需要設計一個彈出窗口(使用css和javascript/jquery),以便在需要時彈出。或者當你想要。

的CSS:

.popUp{ display: none; height: 400px; margin-top: -300px; width: 300px; margin-left: -200px; position: fixed; left: 50%; top: 50%; right: 50%; z-index: 100; background: black; margin-right: 10px; }

的Jquery:

`

function popAuto(button,div){ 
    button.on('click', function(){ 
     if(!div.is(':visible')){ 

       div.fadeIn(); 
      }else{ 

       div.fadeOut(); 
      } 
      }); 
     } 

`

按鈕=在您點擊或單擊上的東西股利。

的div =要彈出DIV。

希望對您有所幫助