投票管理程序_php基础_脚本之家

需要名称为book的mysql数据库表 表中含有下列字段: id下载的文件的唯一标识
downnum点击数 first.php ?while($myrow = @mysql_fetch_array($result)) {
? TR TD ?if(empty($myrow[downnum])) echo 0; else echo
$myrow[downnum]; ?/TD TD ahref=ddload.php?purl=downfileurl&dnnum=?echo
$myrow[‘downnum’] ?&id=?echo $myrow[‘id’]?click here download /a /TD
/TR ?};? ddload.php ? include(data.inc.php); if($incerror) { echo
$incerror; exit; } if(empty($dnnum)) $dnnum = 1; else $dnnum ++; $sql =
update book set downnum =’$dnnum’ where id =$id; mysql_query($sql);
mysql_close($connect); header(location:$purl); ?

投票管理程序 表结构 CREATE TABLE poll not null
AUTO_INCREMENT,Poll_Name char ,Poll_Del INT DEFAULT ‘0’ , PRIMARY KEY
CREATE TABLE pollsele not null AUTO_INCREMENT,Pollsele_Name char
,Poll_Del INT DEFAULT ‘0’ , Pollsele_poll_Id INT ,pollsele_num int ,

PRIMARY KEY

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;
$myrow=mysql_fetch_row; echo “

“; echo “

“; 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; echo “

“; echo “

“; while($myrow=mysql_fetch_row { echo “$myrow[0]澳门新葡亰平台官网,”; echo ” “;} echo

“;echo “
“; echo “”; echo “

“; echo “

“;echo “

“; echo “

“; mysql_close(); echo “
“; echo “

“; echo “管理”; echo “

“;?>

$db
=mysql_connect(“localhost”, “root”,”391450″);
mysql_select_db(“class”,$db); $sql=”select
poll_id,poll_name,poll_del from poll”; echo “

“; $result=mysql_query; while($my=mysql_fetch_row { echo “

“;echo “

“;echo $my[0];echo “

“; echo “

$my[1]

“; echo “

“;echo $my[2];echo “

“; echo “

“; }echo “

“; ?> if($submit2!=”添加”) { echo “

“; echo “

“; echo “主题:”; echo “”; echo “”; echo “”; echo”

“;} 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=”insert into poll values”;
mysql_query; echo “

“;} if($submit1!=”有效”&&$submit3!=”删除”) {echo “

“; echo “

“; echo “设置主题:”; echo “”; $db =mysql_connect(“localhost”,
“root”,”391450″); mysql_select_db(“class”,$db); $sql=”select Poll_Id
from poll”; $result = mysql_query; while($myrow=mysql_fetch_row {
echo “$myrow[0]”;} echo “”; echo “”; echo “”; echo “”; echo “

“; } 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=”update poll set
Poll_Del=’1′ where poll_id=’$sele'”; $result = mysql_query; echo “

“;} else {$db =mysql_connect(“localhost”, “root”,”391450″);
mysql_select_db(“class”,$db); $sql=”delete from poll where
poll_id=’$sele'”; $result = mysql_query; $sql=”delete from pollsele
where pollsele_poll_id=’$sele'”; mysql_query; echo “

“;} } ?>

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 “

“; @$result=mysql_query; while($my=mysql_fetch_row { echo “

“;echo “

“;echo $my[0];echo “

“; echo “

$my[1]

“; echo “

“;echo $my[2];echo “

“; echo “

“;echo $my[3];echo “

“; echo “

“; }echo “

“; ?> if($submit2!=”添加”) {echo “

“; echo “

“; echo “选项:”; echo “”; echo “”; echo “”; echo”

“;} else {$db =mysql_connect(“localhost”, “root”,”391450″);
mysql_select_db(“class”,$db); $sql=”insert into pollsele
values(”,’$title’,”,’$id’,”)”; mysql_query; echo “

“;} if($submit1!=”有效”&&$submit3!=”无效”) {echo “

“; echo “

“; echo “设置选项:”; echo “”; $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; while($myrow=mysql_fetch_row { echo “$myrow[0]”;} echo
“”; echo “”; echo “”; echo “”; echo “

“; } 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;} else { $sql=”update pollsele set Pollsele_Del=’1′ where
pollsele_id=’$sele'”; $result = mysql_query; echo “

“;} ?>

pollsee.php//投票结果

“; echo $title[0]; echo “”; echo “
“; $sql=”select Pollsele_Name,pollsele_num from pollsele where
pollsele_del=’0′ and pollsele_poll_id=’$poll_id'”; @$result =
mysql_query; echo “

“; while($myrow=mysql_fetch_row {echo “

“; echo “

“; echo $myrow[0];echo “

“;echo $myrow[1]; echo “

“;} echo “

“;} else {echo “你不能投空票!!!”;}
?>【本文版权归作者与奥索网共同拥有,如需转载,请注明作者及出处】

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

Leave a Reply

网站地图xml地图