PHP新手上路(九)

建设四个简短交互作用的网址(五卡塔尔 8. 投票系统
在好些个时候,大家必要搜聚上网者和网上老铁们的视角。举例:新版页面与旧版页面包车型地铁可比;对某一事务的见识;对体育比赛结果的预测等等。那时候,你要求一个极度实用的英特网调查系统。使用PHP就足以拾壹分有扶助地促成您的这一构想。
8.1 投票系统: ? $status=0; if(isset($polled卡塔尔(قطر‎($polled==”c-e”卡塔尔(قطر‎卡塔尔{
$status=1; } #echo “$status”; if(isset($poll)($status==0)){
setcookie(“polled”,”c-e”,time()+86400,”/”);#time=24h } ? html head
title新版页面考查/title meta “Content-Type” content=”text/html;
charset=gb2312″ style type=”text/css” !– .tb { border=”1″
bordercolor=”#009933″ cellspacing=”0″ font-size: 9pt; color: #000000}
.head { font-family: “宋体”; font-size: 12pt; font-weight: bold; color:
#009933; text-decoration: none} .pt9 { font-size: 9pt} a.p9:link {
font-size: 9pt; color: #000000; text-decoration: none} a.p9:visited {
font-size: 9pt; color: #000000; text-decoration: none } a.p9:hover {
font-size: 9pt; color: #FF0000; text-decoration: underline} a.p9:active
{ font-size: 9pt; color: #FF0000; text-decoration: underline } —
/style /head body bgcolor=”#澳门新葡亰平台官网,FFFFFF” div
与旧版页面相相比较你感觉新版页面:/divbr ? if(!isset($submit)){ ? form
action=”myPolls.php3″ method=”get” input type=”radio”
name=”poll_voteNr” value=”1″ checked span 音讯量越来越大/span br input
type=”radio” name=”poll_voteNr” value=”2″ span 网页更玄妙/span br input
type=”radio” name=”poll_voteNr” value=”3″ span 没什么校正/span br input
type=”radio” name=”poll_voteNr” value=”4″ span 其余/span br input
type=”submit” name=”submit” value=”OK” input type=”hidden” name=”poll”
value=”vote” A HREF=”myPolls.php3?submit=OK” 查看侦察结果/A /form ?
/* 借使想扩张别的的选项可径直助长就能够 */ }else{
$descArray=array(1=”新闻量更加大”, 2=”网页更了不起”, 3=”没什么修正”,
4=”别的” 卡塔尔(قطر‎; $poll_resultBarHeight = 9; // height in pixels of
percentage bar in result table $poll_resultBarScale = 1; // scale of
result bar (in multiples of 100 pixels) $poll_tableHeader=”table
border=1 “; $poll_rowHeader=”tr”; $poll_dataHeader=”td align=center”;
$poll_dataFooter=”/td”; $poll_rowFooter=”/tr”;
$poll_tableFooter=”/table”; $coutfile=”data.pol”; $poll_sum=0; // read
counter-file if (file_exists( $coutfile)) { $fp = fopen( $coutfile,
“rt”); while ($Line = fgets($fp, 10)) { // split lines into
identifier/counter if (ereg( “([^ ]*) *([0-9]*)”, $Line, $tmp)) {
$curArray[(int)$tmp[1]] = (int)$tmp[2]; $poll_s

You can leave a response, or trackback from your own site.

Leave a Reply

网站地图xml地图