今天无聊做了一个十二生肖查询器:

预览网址效果:http://hongxing01.hktd02u.me48.com/03Sxcx

源代码下载:http://down.51cto.com/data/1985014

这个Demo的学习很适合php初学者学习,练练手。大神勿喷

每个人都是从初学开始的。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>生肖查询</title>
<style>
*{
margin:;
padding:;
}
.knr{
margin: auto;
padding: auto;
width:540px;
}
.tit{
background:url('./img/tit.png') no-repeat;
height:40px;
padding-top:20px;
padding-left:20px;
font:normal bold 12pt serif;
color:#026ea3;
}
.main{
float:left;
borde-left:1px solid #a9c9d0;
border-right:1px solid #a9c9d0;
border-bottom:1px solid #a9c9d0;
width:538px;
}
.inp{
float:left;
width:300px;
margin-left:20px;
margin-top:20px;
}
.intext{
width:250px;
height:25px;
}
.bun{
margin-top:15px;
margin-left:15px;
}
.sximg{
float:left;
border:1px solid #a9c9d0;
width:;
height:;
margin-bottom:10px;
}
</style>
</head>
<body>
<div class="knr">
<div class="tit">
十二生肖查询
</div>
<div class="main">
<div class="inp">
<form action="" method="post">
<input type="text" name="year" class="intext" value="请输入出行年。如:1993,右侧显示生肖" onfocus="this.value=''">
<input type="image" name="submit" class="bun" src="./img/submit.gif">
<input type="image" name="reset" class="bun" src="./img/reset.gif">
</form>
</div>
<div class="res">
<?php
$year = isset($_REQUEST['year']) ? $_REQUEST['year'] : ;
if(isset($year)&&($year> && $year<)){
$sx = $year % ;
?>
<div class="sximg">
<img src="./img/<?php echo $sx?>.png" width="">
</div>
<?php
}else{
echo '请输入正确的出生年份!';
}
?>
</div>
</div>
</div>
</body>
<script src="http://app.baidu.com/static/appstore/monitor.st"></script>
<script>
baidu.app.autoHeight();
baidu.app.setHeight();
</script>
</html>

十二生肖查询网页版制作(php)的更多相关文章

  1. 基于HTML5的捕鱼达人游戏网页版

    之前给大家分享了html5实现的水果忍者,愤怒的小鸟,中国象棋游戏.今天给大家分享一款捕鱼达人(fishjoy)网页版游戏的源码.可以在线玩也可以下载到本地.它使用html5技术和javascript ...

  2. Shell脚本生成网页版相册浏览器

    今天学到了一招,那就是使用脚本制作一款网页版相册浏览器.先上图吧. 必备基础 操作系统: 以linux为内核的操作系统都行 编程语言:Shell(bash)脚本,相关基础知识即可 下载工具:wget ...

  3. JavaScript之简易http接口测试工具网页版

    简易http接口测试工具网页版,支持get.post请求,支持json格式消息体,form表单暂不支持. httpClient.html <!DOCTYPE html> <html ...

  4. Java课程寒假之开发记账本软件(网页版)之一

    一.制定网页版记账本的基础功能 首先是下载了几个记账本APP,大致地看了一下记账本的功能:添加记录(支出,收入,自定义模板),查询流水(分类查询),账户. 二.开始做出框架 鉴于记账本有上面的功能,所 ...

  5. wechat 网页版通信全过程

    想要记录总结一下自己在这个小项目中所遇到的坑,以及解决问题的思路. 首先我觉得这个小项目挺有实际市场的,市场上有一定的需求量,这个就是驱动力吧.这个小项目的关键点是wechat网页版通信全过程,讲真挺 ...

  6. Dreamweaver杀手!Illustrator终结者?Flash的末日?图形图像设计程序之网页版

    Dreamweaver杀手!Illustrator终结者?Flash的末日?图形图像设计程序之网页版 阅读:  评论:  作者:Rybby  日期:  来源:rybby.com Adobe 家的 Il ...

  7. 用requests登录微信网页版,并接收发送消息

    首先,网页版微信登录大致分为以下几个流程(都是大家可以通过抓包得到): 1.登陆主页后,会生成一个UUID,这是个用户标识,在后面请求二维码会用到 def get_uuid(self): '''获取u ...

  8. 五大主流数字币钱包:imToken数字货币钱包,Bitcoin core钱包,BTS网页版钱包,AToken轻钱包,Blockchain

    AToken数字货币钱包 超容易上手支持五大主流币种   互联网 | 编辑: 王静涛 2017-12-28 09:58:33转载     国家监管部门已叫停数字货币交易,包括火币网.比特币中国.OKC ...

  9. 微信号网页版api

    Django Wechat Api djangowechatapi是基于wxpy和django制作的web应用 安装 使用pip pip install djangowechatapi 源码安装 gi ...

随机推荐

  1. c++类对象 指针区别

    class Test{ public: int a; Test(){ a = ; } }; int main1() { Test* t1 = new Test(); t1->a = ; Test ...

  2. ul li的添加 删除 复制 clone()

    语法总结 li=document.createElement('li') li.innerText = tag $('#i1').append(li) $(..).clone()  复制整个文本和Ht ...

  3. Oracle安装盘空间不足,对.DBF文件进行迁移

    一. select * from dba_data_files 使用该条语句可以查看当前库中有多少表空间并且DBF文件的存储位置 二. 找到对应的dbf文件,将该文件复制到你需要移动的位置 三. 开始 ...

  4. Canvas.Pixels 实例:判断一点是否在区域中

    The Windows 3.1 and Windows 95 GDI heap is limited in regards to scan converting large and complex r ...

  5. Redis 字典的实现

    [Redis 字典的实现] 注意 dict 类型使用了两个指针,分别指向两个哈希表. 其中, 0 号哈希表(ht[0])是字典主要使用的哈希表, 而 1 号哈希表(ht[1])则只有在程序对 0 号哈 ...

  6. Python_03-数据类型

    1.1   数据类型 基本数据类型:字符串,整数,浮点数,布尔型 集合类型:列表(list), 元组(tuple), 字典(dictionary或hash) 列表(list)的定义: aList = ...

  7. 怎样查看lInux系统中的所有运行进程

    可以使用ps命令.它能显示当前运行中进程的相关信息,包括进程的PID.Linux和UNIX都支持ps命令,显示所有运行中进程的相关信息. ps命令能提供一份当前进程的快照.如果想状态可以自动刷新,可以 ...

  8. Halcon中xld的常见特征的含义总结

    如下图:

  9. 15 Independent Alleles

    Problem Figure 2. The probability of each outcome for the sum of the values on two rolled dice (blac ...

  10. Android 上传文件到XP

    Android部分: AsyncHttpClient client = new AsyncHttpClient(); RequestParams requestParams = new Request ...