香港高速VIP云机房火爆上线啦!无需备案,开通即用!配套《巅云自助建站系统3.0》将带给您飞一般的可视化拖拽建站体验,欢迎免费体验。

建站专题

投票管理程序

一佰互联网站开发设计(www.yinxi.net) 发布日期 2019-05-01 19:07:15 浏览数: 30

投票管理程序 表结构 CREATE TABLE poll(Poll_Id INT (11) not null AUTO_INCREMENT,Poll_Name char(50) ,Poll_Del INT (10) DEFAULT "0" , PRIMARY KEY (Poll_Id))   CREATE TABLE pollsele(Pollsele_Id INT (11) not null AUTO_INCREMENT,Pollsele_Name char(50) ,Poll_Del INT (10) DEFAULT "0" , Pollsele_poll_Id INT (10) ,pollsele_num int (10), PRIMARY KEY (Pollsele_Id))   ------------------------------------------------------------------------------------------------- poll.php   //主程序 <?     $db =mysql_connect("localhost", "root","391450"); mysql_select_db("class",$db); $sql="select poll_id,Poll_Name from poll where poll_del="1""; @$result = mysql_query($sql);       $myrow=mysql_fetch_row($result);      echo "<table align=center bgcolor=aabbcc width=250 hight=450 border=0 style="border:1px solid rgb(0,0,0)">";          echo "<td align=center bgcolor=99aabb style="border:1px solid rgb(255,255,255)">";       echo "$myrow[1]";        $sql="select Pollsele_Name,pollsele_poll_id from pollsele where pollsele_del="0" and pollsele_poll_id="$myrow[0]""; @$result = mysql_query($sql);   echo "<FORM ACTION="pollsee.php?poll_id=$myrow[0]" METHOD="post" target=_blank>";      echo "<p align=center>";    while($myrow=mysql_fetch_row($result))    {    echo "<input type="radio" name=toupiao value="$myrow[0]">$myrow[0]";      echo " ";                                          }    echo "<br>";  echo "<br>";   echo "<input type=submit name=submit value="投票" >";    echo "</p>";   echo "</form>";      echo "</td>";        echo "</table>";    mysql_close();     echo "<br>";     echo "<p align=right>";    echo "<a href=poll_input>管理</a>"; echo "</p>";     ?> ----------------------------------------------------------------------- poll_input.php  //添加主题 <?        $db =mysql_connect("localhost", "root","391450"); mysql_select_db("class",$db);        $sql="select poll_id,poll_name,poll_del from poll";               echo "<table width=300 hight=560 bgcolor=aabbcc align=center style="border:1px solid rgb(0,0,0)">";              $result=mysql_query($sql);              while($my=mysql_fetch_row($result))             {     echo "<tr>";echo "<td align=center width=50 bgcolor=99aabb style="border: 1px solid rgb(255,255,255)">";echo $my[0];echo "</td>";               echo "<td align=center width=200 bgcolor=99aabb style="border: 1px solid rgb(255,255,255)"><a href=pollsele.php?id=$my[0]>$my[1]</a></td>";     echo "<td align=center width=50 bgcolor=99aabb style="border: 1px solid rgb(255,255,255)">";echo $my[2];echo "</td>";                  echo "</tr>";                   }    echo "</table>";                    ?> <html> <head>   <?            if($submit2!="添加")              { echo "<p align=center>";              echo "<FORM ACTION="poll_input.php" METHOD="post">";         echo "<font color=004080>主题:</font>";        echo "<input type=text name=title size=30 value="">";       echo "<input type=submit name=submit2 value="添加">";                     echo "</p>";            echo"</form>";   } else       {$db =mysql_connect("localhost", "root","391450"); mysql_select_db("class",$db);        $sql="select poll_name from poll where poll_name="$title"";              mysql_query($sql); $sql="insert into poll values("","$title","")"; mysql_query($sql); mysql_close(); echo "<META HTTP-EQUIV=REFRESH CONTENT="1; URL=poll_input.php">";  }            if($submit1!="有效"&&$submit3!="删除")            {  echo "<p align=center>";            echo "<FORM ACTION="poll_input.php" METHOD="post">";            echo "<font color=004080>设置主题:</font>";    echo "<select name="sele" size=1>";          $db =mysql_connect("localhost", "root","391450"); mysql_select_db("class",$db); $sql="select Poll_Id from poll"; $result = mysql_query($sql); mysql_close(); while($myrow=mysql_fetch_row($result)) { echo "<option value="$myrow[0]">$myrow[0]";}    echo "</select>";      echo "<input type=submit name=submit1 value="有效">";         echo "<input type=submit name=submit3 value="删除">";        echo "</p>"; echo "</FORM>";            }            else            {               if($submit1=="有效")               {            $db =mysql_connect("localhost", "root","391450"); mysql_select_db("class",$db); $sql="update poll set Poll_Del="0""; $result = mysql_query($sql);   $sql="update poll set Poll_Del="1" where poll_id="$sele""; $result = mysql_query($sql); mysql_close(); echo "<META HTTP-EQUIV=REFRESH CONTENT="1; URL=poll_input.php">";      }     else     {   $db =mysql_connect("localhost", "root","391450"); mysql_select_db("class",$db); $sql="delete from poll where poll_id="$sele""; $result = mysql_query($sql); $sql="delete from pollsele where pollsele_poll_id="$sele""; mysql_query($sql); mysql_close(); echo "<META HTTP-EQUIV=REFRESH CONTENT="1; URL=poll_input.php">";      } } ?> -------------------------------------------------------------------- pollsele.php  //添加选项 <?        $db =mysql_connect("localhost", "root","391450"); mysql_select_db("class",$db);        $sql="select pollsele_id,pollsele_name,pollsele_del,pollsele_num from pollsele where pollsele_poll_id="$id"";               echo "<table width=300 hight=560 align=center bgcolor=aabbcc style="border:1px solid rgb(0,0,0)" >";              @$result=mysql_query($sql);              while($my=mysql_fetch_row($result))             {     echo "<tr>";echo "<td align=center width=50 bgcolor=99aabb  style="border: 1px solid rgb(255,255,255)">";echo $my[0];echo "</td>";               echo "<td align=center width=200 bgcolor=99aabb  style="border: 1px solid rgb(255,255,255)">$my[1]</td>";     echo "<td align=center width=50 bgcolor=99aabb  style="border: 1px solid rgb(255,255,255)">";echo $my[2];echo "</td>";          echo "<td align=center width=50 bgcolor=99aabb  style="border: 1px solid rgb(255,255,255)">";echo $my[3];echo "</td>";                  echo "</tr>";                   }    echo "</table>";                    ?> <html> <head>   <?            if($submit2!="添加")              {     echo "<p align=center>";              echo "<FORM ACTION="pollsele.php?id=$id" METHOD="post">";         echo "<font color=004080>选项:</font></td>";        echo "<input type=text name=title size=30 value="">";       echo "<input type=submit name=submit2 value="添加">";                     echo "</p>";            echo"</form>";   } else       {$db =mysql_connect("localhost", "root","391450"); mysql_select_db("class",$db); $sql="insert into pollsele values("","$title","","$id","")"; mysql_query($sql); mysql_close(); echo "<META HTTP-EQUIV=REFRESH CONTENT="1; URL=pollsele.php?id=$id">";  }            if($submit1!="有效"&&$submit3!="无效")            {  echo "<p align=center>";            echo "<FORM ACTION="pollsele.php?id=$id" METHOD="post">";             echo "<font color=004080>设置选项:</font>";    echo "<select name="sele" size=1>";          $db =mysql_connect("localhost", "root","391450"); mysql_select_db("class",$db); $sql="select Pollsele_Id from pollsele where pollsele_poll_id="$id""; $result = mysql_query($sql); mysql_close(); while($myrow=mysql_fetch_row($result)) { echo "<option value="$myrow[0]">$myrow[0]";}    echo "</select>";      echo "<input type=submit name=submit1 value="有效">";         echo "<input type=submit name=submit3 value="无效">";       echo "</p>"; echo "</FORM>";            }            else            { $db =mysql_connect("localhost", "root","391450"); mysql_select_db("class",$db);       if ($submit1=="有效")       {     $sql="update pollsele set Pollsele_Del="0" where pollsele_id="$sele""; $result = mysql_query($sql);} else { $sql="update pollsele set Pollsele_Del="1" where pollsele_id="$sele""; $result = mysql_query($sql);   } mysql_close(); echo "<META HTTP-EQUIV=REFRESH CONTENT="1; URL=pollsele.php?id=$id">";      } ?> ---------------------------------------------------------------------- pollsee.php  //投票结果 <?       if ($toupiao!=""){ $db =mysql_connect("localhost", "root","391450"); mysql_select_db("class",$db);   $sql="select Pollsele_Name,pollsele_num from pollsele where pollsele_name="$toupiao""; @$result = mysql_query($sql);   $myrow=mysql_fetch_row($result);   $poll_num=$myrow[1];   $poll_num=$poll_num+1; $sql="update pollsele set Pollsele_num="$poll_num" where pollsele_name="$toupiao""; mysql_query($sql);     $sql="select Poll_Name from poll where poll_id="$poll_id""; @$result = mysql_query($sql);      $title=mysql_fetch_row($result);        echo "<p align=center>";       echo $title[0]; echo "</p>";       echo "<br>";        $sql="select Pollsele_Name,pollsele_num from pollsele where pollsele_del="0" and pollsele_poll_id="$poll_id""; @$result = mysql_query($sql);       echo "<table align=center bgcolor=aabbcc style="border:1px solid rgb(0,0,0)">";   while($myrow=mysql_fetch_row($result))   {   echo "<tr>"; echo "<td width=150 bgcolor=99aabb style="border:1px solid rgb(255,255,255)">";   echo $myrow[0];echo "</td><td width=50 bgcolor=99aabb style="border:1px solid rgb(255,255,255)">";echo $myrow[1]; echo "</td></tr>";} echo "</table>";  }   else   {echo "<font color=red>你不能投空票!!!</font>";}     ?>  【本文版权归作者与奥索网共同拥有,如需转载,请注明作者及出处】    
TAG标签: 投票管理程序  
一佰互联是全国知名建站品牌服务商,我们有九年网站建设、网站制作、网页设计、php开发和域名注册及虚拟主机服务经验,提供的自助建站服务更是全国有名。近年来还整合团队优势自主开发了可视化多用户”巅云建站系统“3.0平台版,拖拽排版网站制作设计,轻松实现pc站、手机微网站、小程序、APP一体化全网营销网站建设 ,已成功的为全国上百家网络公司提供自助建站平台搭建服务。

相关新闻more

05
04月
网站制作编排必知的事项

影响网站的浏览量的因素有很多,可能是网站的页面布局、网站的内容、网站操作的方式等等。好的网站会在其运行期间不间断的进行优化工作,找出不要的因... >>详情

20
04月
HTML5之SVG 2D入门7—SVG元素的

前面介绍了很多的图形元素,如果很多图形本身是一样的,需要每次都去定义一个新的么?我们能否共用一些图形呢?这是这节的重点-SVG元素的重用。 ... >>详情

28
03月
手机邮箱APP排行榜,网易第2新浪第8 你用

简介:近日,由《互联网周刊》和eNet研究院共同评选的《2018年度APP分类排行榜》出炉了,小编想和大家聊一下这份分类榜单中的2018年度... >>详情

15
04月
高端网站建设-360搜索推出独立品牌“好搜”

1月5日下午消息,360总裁齐向东今日向全体员工发送邮件,宣布360搜索将正式推出独立品牌——好搜(haosou.c... >>详情

营业执照. cdn加速服务 备案系统认证 网络安全协会 我们的支付方式AAA认证
上海 北京 深圳 广州 天津 杭州 南京 武汉 成都 沈阳 大连 长沙 济南 青岛 苏州 福州 无锡 哈尔滨 宁波 重庆 大庆 厦门 西安 长春 珠海 郑州 海口 昆明 太原 石家庄 温州 合肥 乌鲁木齐 南宁 南通 合肥 兰州 呼和浩特 贵阳 烟台 秦皇岛 包头 唐山 银川 汕头 连云港 威海 西宁 湛江 北海 万州 涪陵 长寿 黔江 永川 丰都 忠县 江津 南川 开县 云阳 万盛 梁平 垫江 巫山 城口 建站宝盒 免费建站 门户网站建设 微信网站 手机网站 门户网站制作

7x24小时服务电话:18581389571 传真:023-85725751 免费建站交流群:236412099 139947842(自助建站交流) E-Mail:post@yinxi.net 网站投诉:
重庆楚捷科技有限公司 一佰互联©版权所有 自助建站(www.yinxi.net,Inc.) 2001-2020 All Rights Reserved 本站程序受法律保护,网站法律顾问:ITLAW-庄毅雄律师
中华人民共和国信息产业部网站备案号:渝ICP备12000592号