WEB第二次实验报告(共8页)_第1页
WEB第二次实验报告(共8页)_第2页
WEB第二次实验报告(共8页)_第3页
WEB第二次实验报告(共8页)_第4页
WEB第二次实验报告(共8页)_第5页
已阅读5页,还剩3页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、精选优质文档-倾情为你奉上实 验 报 告(2014 / 2015 学年 第 二 学期)课程名称Web技术实验名称Web服务端脚本编写实验时间2015年5月13日指导单位南京邮电大学指导教师韩京宇学生姓名班级学号学院(系)计算机学院专 业软件工程专心-专注-专业实 验 报 告实验名称Web服务端脚本编写指导教师韩京宇实验类型课内实验学时2实验时间2015.5.13一、 实验目的和要求实验目的:1. 通过上机实验,熟悉Apache服务器的安装和配置使用方法。2. 掌握php脚本语言,熟练运用php语言进行服务端编程。 二、实验环境(实验设备)EditPlus3、 实验原理及内容<head&g

2、t; <meta charset="UTF-8"> <meta name="Generator" content="EditPlus®"> <meta name="Author" content="steacymar"> <meta name="Keywords" content=""> <meta name="Description" content="&quo

3、t;> <title>Welcome to book seller</title> </head> <body> <form action = "Welcome.php" method = "post"> <h1><font face="黑体">You are welcome</font></h1> <table><tr><td>please input your name: </

4、td><td><input type = "text" name = "name"/></td></tr><tr><td>please input your address: </td><td><input type = "text" name = "address"/></td></tr><tr><td>please input your zip: &l

5、t;/td><td><input type = "text" name = "zip"/></td></tr> </table> <p><font face="黑体">please fill in the quantity field of the following form:</font> </p> <table border = "border"><tr><th>

6、;book</th><th>publisher</th><th>price</th><th>quantity</th></tr><tr><th>Web technology</th><td>Springer press</td><td>$5.0</td><td><input type = "text" name = "wt" /></td>&

7、lt;/tr><tr><th>mathematics</th><td>ACM press</td><td>$6.2</td><td><input type = "text" name = "mm" /></td></tr><tr><th>principle of OS</th><td>Science press</td><td>$10</td

8、><td><input type = "text" name = "pOS" /></td></tr><tr><th>Theory of matrix</th><td>High education press</td><td>$7.8</td><td><input type = "text" name = "tom" /></td></t

9、r> </table> <p>payment method:</p> <p> <input type = "radio" name="payment" value = "cash" checked = "checked"/>cash <input type = "radio" name="payment" value = "cheque"/>cheque <input ty

10、pe = "radio" name="payment" value = "credit card"/>credit card </p> <p><input type = "submit" value = "Submit"/><input type = "reset" value = "Reset"/> </p> </form> </body></html>

11、 Welcome.php<html><head></head><body>customer name: <?php echo $_POST"name" ?></br>customer address: <?php echo $_POST"address" ?></br>customer zip: <?php echo $_POST"zip" ?></br><table border = "border

12、"><tr><th>book</th><th>publisher</th><th>price</th><th>total cost</th></tr><?php function total($price,$quantity)$total = $price*$quantity;return $total;?><?php if( $_POST"wt" != 0)echo "<tr><th>W

13、eb technology</th><td>Springer press</td><td>$5.0</td><td> ".total(5,$_POST"wt")." </td></tr>"if($_POST"mm" != 0) echo"<tr><th>mathematics</th><td>ACM press</td><td>$6.2</td

14、><td>".total(6.2,$_POST"mm")."</td></tr>"if($_POST"pOS" != 0) echo"<tr><th>principle of OS</th><td>Science press</td><td>$10</td><td>".total(10,$_POST"pOS")."</td>&l

15、t;/tr>"if($_POST"tom" != 0) echo"<tr><th>Theory of matrix</th><td>High education press</td><td>$7.8</td><td>".total(7.8,$_POST"tom")."</td></tr>" ?> </table> <p><?php echo $_

16、POST"name"." has bought ".($_POST"wt"+$_POST"mm"+$_POST"pOS"+$_POST"tom")." books." ?></p><p><?php $sum = 5*$_POST"wt"+6.2*$_POST"mm"+10*$_POST"pOS"+7.8*$_POST"tom"echo $_P

17、OST"name"." paid ".$sum."." ?></p><p>paid by <?php echo $_POST"payment"."." ?></p><?php$file = fopen("test.txt","w+");fwrite($file,$_POST"name"."hasbought ".($_POST"wt"+$_POST"mm"+$_POST"pOS"+$_POS

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论