<body><?phpsleep(3);//执行到这里的时候等待3秒/*这里的数据是假数据,真正的场景中数据基本上都是来自数据库。*/$arr = array();$arr[0] = array('name'=>'三国演义','auhor'=>'罗贯中','category'=>'古典文学','desc'=>'一个群雄争霸的年代');$arr[1] = array('name'=>'水浒传','auhor'=>'施耐庵','category'=>'历史文学','desc'=>'108好汉的故事');$arr[2] = array('name'=>'红楼梦','auhor'=>'曹雪芹','category'=>'爱情文学','desc'=>'一个封建王朝的繁荣末落');$arr[3] = array('name'=>'西游记','auhor'=>'吴承恩','category'=>'神话文学','desc'=>'佛教与道教之间的较量');$arr[4] = array('name'=>'西厢记','auhor'=>'王实甫','category'=>'古典文学','desc'=>'封建王朝悲催的爱情故事');?><table cellpadding="0" cellspacing="0"><thead><tr><td>名称</td><td>作者</td><td>分类</td><td>描述</td></tr></thead><tbody><?php foreach($arr as $value) { ?><tr><td><?php echo $value['name']; ?> </td><td><?php echo $value['auhor']; ?> </td><td><?php echo $value['category']; ?> </td><td><?php echo $value['desc']; ?> </td></tr><?php } ?></tbody></table>
</body>
header('Content-Type:text/html; charset=utf-8');echo '<div style="color:red;"><span>测试数据</span><span>测试数据</span><span>测试数据</span></div>';
<div><?php // 服务器端渲染页面$arr = array();$arr['123'] = array("username"=>"张三","chinese"=>"130","math"=>"149","english"=>"146","summary"=>"298");$arr['124'] = array("username"=>"李四","chinese"=>"100","math"=>"140","english"=>"136","summary"=>"298");$arr['125'] = array("username"=>"王五","chinese"=>"90","math"=>"139","english"=>"126","summary"=>"298");$arr['126'] = array("username"=>"赵六","chinese"=>"30","math"=>"50","english"=>"80","summary"=>"100");$code = $_POST['code'];if($code == 'admin'){foreach($arr as $value){echo "<ul><li>姓名:$value[username]</li><li>语文:$value[chinese]</li><li>数学:$value[math]</li><li>英语:$value[english]</li><li>综合:$value[summary]</li></ul>";}}else{$score = $arr[$code];echo "<ul><li>姓名:$score[username]</li><li>语文:$score[chinese]</li><li>数学:$score[math]</li><li>英语:$score[english]</li><li>综合:$score[summary]</li></ul>";}?></div>
<form action="03考生成绩.php" method="post">考号:<input type="text" name="code"><input type="submit" value="查询"></form>
<?php
$uname = $_POST['username'];
$pw = $_POST['password'];// if($uname == 'admin' && $pw == '123'){
// echo '登录成功';
// }if($uname == 'admin' && $pw == '123'){
?><script type="text/javascript">ElementById('info').innerHTML = '登录成功';</script>
<?php }else{ ?><script type="text/javascript">ElementById('info').innerHTML = '登录失败';</script>
<?php } ?>
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>登录</title><script type="text/javascript">/*隐藏帧实现局部更新实际上iframe就相当于页面的子页面*/</script>
</head>
<body><div><form action="./iframe.php" method="post" target="myframe">用户名:<input type="text" name="username"><span id="info"></span><br>密码:<input type="text" name="password"><input type="submit" value="登录"></form></div><iframe width="0" height="0" frameborder="0" name=
本文发布于:2024-02-05 00:53:35,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170720361161560.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |