嘿,伙计们,我正在为我的项目制作一个网页航空公司预订,在主页上我保留了一些文本框,当我点击提交按钮时,它会在页面上的表中显示数据。。但我想在弹出屏幕中显示整个表格。。所以当我点击搜索按钮时,它应该会搜索数据库,并在弹出框的表格中显示可预订的航班。。。
这是数据显示在页面上的基本代码。。我想将其更改为在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">
       <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>      
<a href="search.php">Search Flight</a>      
<a href="about.php">About us</a>      
<a href="help.php">Help/FAQ</a>      
</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>
如果我理解你的意思,你想把这个页面弹出吗?所以你可以使用:
<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();
}
});
}
`
button=div你点击的地方或你点击的东西。
div=要弹出的div。
希望这对有帮助