国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數(shù)據(jù)庫 > MySQL > 正文

PHP+MySQL實(shí)現(xiàn)的簡單投票系統(tǒng)實(shí)例

2020-03-22 18:06:11
字體:
供稿:網(wǎng)友
本文實(shí)例講述了PHP+html' target='_blank'>MySQL實(shí)現(xiàn)的簡單投票系統(tǒng)。分享給大家供大家參考,具體如下: html head title 手機(jī)系統(tǒng)調(diào)查問卷 /title style type="text/css" span{ width:600px; height:100px; background-color:write; postion:relative; border:1px #cccccc solid; width:60px; height:1px; background-color:blue; postion:absolute; bottom:0; /style /head body 你現(xiàn)在使用的手機(jī)是什么系統(tǒng)? form id="form1" method="POST" action="count.php" input type="radio" name="phone" value="1" Android安卓 input type="radio" name="phone" value="2" Symbian塞班 input type="radio" name="phone" value="3" iphone蘋果 input type="radio" name="phone" value="4" Google谷歌 input type="radio" name="phone" value="5" Winphone微軟 input type="radio" name="phone" value="6" 其它 input type="submit" value="提交" /form span 當(dāng)前票數(shù): br include 'connect.php';$sql="select answer from countone";$rs=mysql_query($sql);$total=mysql_num_rows($rs);$sql="select * from countone where answer=1";$rs=mysql_query($sql);$android=mysql_num_rows($rs);$sql="select * from countone where answer=2";$rs=mysql_query($sql);$symbian=mysql_num_rows($rs);$sql="select * from countone where answer=3";$rs=mysql_query($sql);$iphone=mysql_num_rows($rs);$sql="select * from countone where answer=4";$rs=mysql_query($sql);$google=mysql_num_rows($rs);$sql="select * from countone where answer=5";$rs=mysql_query($sql);$winphone=mysql_num_rows($rs);$sql="select * from countone where answer=6";$rs=mysql_query($sql);$other=mysql_num_rows($rs); table border="0" th android /th th Symbian /th th iphone /th th Google /th th winphone /th th other /th td php echo $android 票 /td td php echo $symbian 票 /td td php echo $iphone 票 /td td php echo $google 票 /td td php echo $winphone 票 /td td php echo $other 票 /td /tr td php for ($i=1;$i =$android/$total+1;$i=$i+0.1){ echo " div /div } /td td php for ($i=1;$i =$symbian/$total+1;$i=$i+0.1){ echo " div /div } /td td php for ($i=1;$i =$iphone/$total+1;$i=$i+0.1){ echo " div /div } /td td php for ($i=1;$i =$google/$total+1;$i=$i+0.1){ echo " div /div } /td td php for ($i=1;$i =$winphone/$total+1;$i=$i+0.1){ echo " div /div } /td td php for ($i=1;$i =$other/$total+1;$i=$i+0.1){ echo " div /div } /td /tr /table /span /body /html 寫的有點(diǎn)啰嗦,有點(diǎn)笨但很實(shí)用include 'connect.php';$name=$_POST['phone'];$sql="insert into countone values(null,$name,now(),null)";mysql_query($sql); script type="text/javascript" alert ("投票成功!"); location="question.php"; /script 鏈接mysql:mysql_connect("localhost","root","");mysql_select_db("vote");mysql_query("set names utf8");
更多關(guān)于PHP相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《php面向?qū)ο?/u>程序設(shè)計(jì)入門教程》、《php字符串(string)用法總結(jié)》、《php+mysql數(shù)據(jù)庫操作入門教程》及《php常見數(shù)據(jù)庫操作技巧匯總》希望本文所述對大家PHP程序設(shè)計(jì)有所幫助。PHP教程

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請第一時(shí)間聯(lián)系我們修改或刪除,多謝。

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 扶沟县| 米易县| 岳池县| 龙井市| 巴彦县| 绥阳县| 北碚区| 牙克石市| 左权县| 怀集县| 南江县| 将乐县| 化州市| 山丹县| 临高县| 江孜县| 嘉荫县| 平定县| 乐至县| 德昌县| 海淀区| 祥云县| 涞源县| 洛川县| 瑞安市| 吉林市| 鄯善县| 长子县| 紫金县| 西贡区| 城步| 米脂县| 冕宁县| 寿光市| 莱州市| 东台市| 宁南县| 商城县| 五指山市| 宜良县| 同仁县|