web技术实验报告
(7)根据用户的选择方式显示“paid by (支付方式)”。
3将用户购买信息存入到文件当中,每个客户包含三行信息,即2中的(5)(6)(7)三句话。
4如果用户按的是“重置按钮”,则清楚所有的输入信息。
四丶实验过程
<html xmlns>
<head>
<title>Welcome to book seller</title>
$total_price=$web_cost+$math_cost+$OS_cost+$matrix_cost;
$total_items=$web+$math+$OS+$matrix;
?>
<h4>Custormer:</h4>
<?php
print("$name<br/>$street<br/>$city<br/>");
Cash<br/>
<input type="radio" name="payment" value="Cheque" />
Cheque<br/>
<input type="radio" name="payment" value="Credit Card" />
Credit Card<br/><br/>
</tr>
<tr align="center">
<td>Theory of matrix</td>
<td>High eduction press</td>
<td>$7.8</td>
<td><?php printf("$ %4.2f",$matrix_cost);?></td>
</tr>
</table>
(2)页面内容第一行黑体显示“You are welcome”。
(3)标签提示“please input your name”,并创建输入框。
(4)标签提示“please input your address”,并创建输入框。
(5)标签提示“please input your zip”,并创建输入框。
五丶实验结论
通过该实验,我对PHP脚本语言有了更近的认识,能基本熟练运用PHP语言进行服务器端的编程,开始对html中数据的获取不太清楚,后来查看实验指导和书本有所了解。
实验报告
(2014 / 2015学年第2学期)
课程名称
Web技术
实验名称
Web服务端脚本编写
实验时间
2015
年
05
月
13
日
指导单位
南京邮电大学计算机学院
指导教师
韩京宇
学生姓名
陶飞
班级学号
B13040932
学院(系)
计算机软件
专业
软件工程
实验报告
实验名称
Web服务端脚本编写
指导教师
韩京宇
实验类型
上机
实验学时
</head>
<body>
<form action="http://localhost/qwe.php" method="post">
<h1>You are wlcome</h1>
<table>
<tr>
<td>please input your name</td>
<td><input type="text" name="name" size="30"/></td>
</tr>
<tr>
<td>please input your address</td>
<td><input type="text" name="street" size="30"/></td>
</tr>
<tr>
<td>please input your zip</td>
<td><input type="text" name="city" size="30"/></td>
$street=$_POST["street"];
$city=$_POST["city"];
$payment=$_POST["payment"];
$web_cost=5.0*$web;
$math_cost=10*$OS;
$matrix_cost=7.8*$matrix;
</tr>
</table>
<p/>
<table border="border">
<h2>please fill in the quantity field of the following form</h2>
<tr>
<th>book</th>
<th>publisher</th>
<th>price</th>
(3)customer zip
(4)以表格形式显示订购图书信息,包括四列“book”,“publisher”,“price”,“total cost”,其中total通过脚本动态计算生成。未购买的图书不显示。
(5)计算并显示“(名字)has bought(数量)books”。
(6)计算并显示“(名字)paid(总额)”。
<td>$6.2</td>
<td><?php printf("$ %4.2f",$math_cost);?></td>
</tr>
<tr align="center">
<td>principle of OS</td>
<td>Science press</td>
<td>$10</td>
<td><?php printf("$ %4.2f",$OS_cost);?></td>
<title>Process the qwe.html form</title>
</head>
<body>
<?php
$web=$_POST["web"];
$math=$_POST["math"];
$OS=$_POST["OS"];
$matrix=$_POST["matrix"];
$name=$_POST["name"];
<th>quantity</th>
</tr>
<tr>
<td>Web technology</td>
<td>Springer press</td>
<td>$5.0</td>
<td align="center">
<input type="text" name="web" size="3"/></td>
</tr>
<td>Science press</td>
<td>$10</td>
<td align="center">
<input type="text" name="OS" size="3"></td>
</tr>
<tr>
<td>Theory of matrix</td>
<td>High education press</td>
var d = b*b-4.0*a*c;
if(d<0)
document.write("Error Input!<br />");
else{
var root_part=Math.sqrt(d);
var denom=2.0*a;
var root1=(-b + root_part)/denom;
var root2=(-b - root_part)/denom;
<p/><p/>
<?php
print("$name has bought $total_items books<br>");