duan35557593 2012-07-11 15:00
浏览 35

PHP中需要的少量信息

i am working on a project which is airways ticketing.

i am able to display the final ticket to the user but how can i give user the ability to print it when he/she clicks on print button.

please help..

    <title>Untitled Document</title>
    <style type="text/css">
    #main {
position:absolute;

top:100px;
width:100%;
height:250px;
z-index:1;
}
#submit {
position:absolute;

top:300px;
width:100%;
height:42px;
z-index:2;
}
</style>
</head>

<body>
<div id="main" align="center">
<?PHP
mysql_connect("127.0.0.1","root","");
mysql_select_db("cmc");
$id=$_REQUEST['id'];
$r=mysql_query("select * from manifest where transid=".$id);
$d=mysql_fetch_assoc($r);
?>

<table width="800" border="1">
<tr>
<td colspan="6" align="center">HORIZON AIRWAYS PASSENGER TICKET</td>

</tr>
<tr >
<td colspan="3" align="center">PNR NUMBER: </td>
<td colspan="3" align="center"><?php echo $d["pnrno."]; ?></td>

</tr>
<tr >
<td colspan="3" align="center"> PASSENGER'S NAME:</td>
<td colspan="3" align="center"><?php echo $d["name"]; ?></td>

</tr>
<tr >
<td colspan="3" align="center">DATE OF ISSUE:</td>
<td colspan="3" align="center"><?PHP 
ini_set('date.timezone','asia/calcutta');
echo date("d/m/y"); ?></td>

</tr>
<tr >
<td colspan="3" align="center">TIME OF ISSUE:</td>
<td colspan="3" align="center"><?PHP  
echo date("h/i/s"); ?></td>

</tr>
<tr >
<td colspan="3" align="center">DATE OF JOURNEY:</td>
<td colspan="3" align="center"><?php echo $d["day"]."-".$d["month"]."-".$d["year"]; ?>         </td>

</tr>
<tr>
<td colspan="6" align="center">NOT TRANSFERRABLE</td>

</tr>
<tr>
<td colspan="3" align="center">PASSENGER NAME:</td>
<td colspan="3" align="center"><?php echo $d["name"]; ?></td>
</tr>
<tr>
<td colspan="3" align="center">SECTOR:</td>
<td colspan="3" align="center"><?php echo $d["sector"]; ?></td>
</tr>
<tr>
<td width="134" align="center">FLIGHT #</td>
<td width="132" align="center">CLASS</td>
<td width="112" align="center">DATE</td>
<td width="130" align="center">DEP. TIME</td>
<td width="132" align="center">ARR. TIME</td>
<td width="120" align="center">STATUS</td>
</tr>
<tr>
<td><?php echo $d["flight_no."]; ?></td>
<td><?php echo $d["class"]; ?></td>
<td><?php echo $d["name"]; ?></td>
<td><?php echo $d["departure"]; ?></td>
<td><?php echo $d["arrival"]; ?></td>
<td><?php echo "confirm"; ?></td>
</tr>

</table>
<div id="submit" align="center">
<form name="form1" method="POST">
<input type="submit" value="Print" name="submit"/>
</form>
</div>



</div>
</body>
</html>
  • 写回答

4条回答 默认 最新

  • doushao1087 2012-07-11 15:02
    关注

    Printing has to be done on the client side, not the server side. This shouldn't be a form (I would actually make it a link). The simplest method:

    <input type="submit" value="Print" onclick="print(); return false;"/>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题