|
楼主 |
发表于 2020-4-16 18:04:08
|
显示全部楼层
基本完成老师上星期布置的任务
html部分代码
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1.0,uese-scalable=no "/>
- <title>欢迎来到测试小站</title>
- <style type="text/css">
- @keyframes bounce {
- from,20%,53%,80%,
- to {
- -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
- transform: translate3d(0, 0, 0);
- }
- 40%,43% {
- -webkit-animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
- animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
- -webkit-transform: translate3d(0, -30px, 0);
- transform: translate3d(0, -30px, 0);
- }
- 70% {
- -webkit-animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
- animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
- -webkit-transform: translate3d(0, -15px, 0);
- transform: translate3d(0, -15px, 0);
- }
- 90% {
- -webkit-transform: translate3d(0, -4px, 0);
- transform: translate3d(0, -4px, 0);
- }
- }
-
- .bounce {
- -webkit-animation-name: bounce;
- -webkit-transform-origin: center bottom;
- transform-origin: center bottom;
- }
-
- body {
- background-image:url("用于简历的图片/背景2.jpg");
- background-position: center;
- background-repeat: no-repeat;
- }
-
- h1{
- text-align: center;
- color:dodgerblue;
- animation:bounce 1s;
- animation-direction: alternate;
- animation-iteration-count: 1;
- }
-
- #content{
- height:450px;
- width:100%;
- text-align:center;
- line-height:450px;
- }
-
- #search_txt{
- border:1px solid #b8b8b8;
- line-height:30px;
- }
-
- #search{
- line-height:30px;
- border:1px solid #3385ff;
- background-color: #3385ff;
- color:white;
- margin-left:-8px;
- font_size:16px;
- width:100px;
- }
-
- </style>
- </head>
- <body>
- <h1 >欢迎来到测试小站</h1>
- <form action="mysqli4.php" method="get">
- <div id="content">
- <input type="text" name="text" id="search_txt" size="80"/>
- <input type="submit" value="Search" id="search" name="submit"/>
- </div>
- </form>
- </body>
- </html>
复制代码
php部分代码
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1.0,uese-scalable=no "/>
- <title>查询结果页面</title>
- <style>
- body {
- background-color:antiquewhite
- }
- .css {
- background: lightyellow;
- }
- .result{
- text-align: center;
- }
- </style>
-
- <body>
- <?php
- echo "<h1 class=result>THE RESULT</h1>";
- echo "<div class=css>";
- if(empty($_GET['sunmit'])){
- $keyword=$_GET['text'];
- }
-
- $link=mysqli_connect('localhost','root','123456');
-
- mysqli_set_charset($link,'utf8');
-
- mysqli_select_db($link,'php.cn');
-
- $sql="select * from 工作表1 where 姓名 like '%{$keyword}%'";
-
- $res=mysqli_query($link,$sql);
-
- echo '<table border="1" style="margin:0 ">';
-
- echo '<th>姓名</th>
- <th>性别</th>
- <th>生日</th>
- <th>年龄</th>
- <th>籍贯</th>
- <th>民族</th>
- <th>QQ</th>
- <th>联系方式</th>
- <th>微信</th>
- <th>爱好</th>
- <th>学历</th>
- <th>所在学院</th>
- <th>专业</th>
- <th>学号</th>
- <th>玩的游戏</th>
- <th>偶像</th>
- <th>抖音号</th>
- <th>微博</th>
- <th>注册过的网站</th>
- <th>外语水平</th>';
-
- while($rows=mysqli_fetch_array($res)){
- echo '<tr>';
- echo '<td>'.$rows['姓名'].'</td>';
- echo '<td>'.$rows['性别'].'</td>';
- echo '<td>'.$rows['生日'].'</td>';
- echo '<td>'.$rows['年龄'].'</td>';
- echo '<td>'.$rows['籍贯'].'</td>';
- echo '<td>'.$rows['民族'].'</td>';
- echo '<td>'.$rows['QQ'].'</td>';
- echo '<td>'.$rows['联系方式'].'</td>';
- echo '<td>'.$rows['微信'].'</td>';
- echo '<td>'.$rows['爱好'].'</td>';
- echo '<td>'.$rows['学历'].'</td>';
- echo '<td>'.$rows['所在学院'].'</td>';
- echo '<td>'.$rows['专业'].'</td>';
- echo '<td>'.$rows['学号'].'</td>';
- echo '<td>'.$rows['玩的游戏'].'</td>';
- echo '<td>'.$rows['偶像'].'</td>';
- echo '<td>'.$rows['抖音号'].'</td>';
- echo '<td>'.$rows['微博'].'</td>';
- echo '<td>'.$rows['注册过的网站'].'</td>';
- echo '<td>'.$rows['外语水平'].'</td>';
- }
-
- echo '</table>';
-
-
- mysqli_close($link);
-
- echo "</div>";
-
- ?>
- </body>
- </html>
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|