⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 edit_choice.php

📁 一个投票系统
💻 PHP
字号:
<?
include ("const.php");
if (!(session_is_registered("admins")))
{
   echo "<script language='javascript'>alert('您还未登录!');window.location.href='admin.php';</script>";
   exit;
}
else
{
   if($HTTP_POST_VARS["actions"]=="1")
   {
      $choice=trim($HTTP_POST_VARS["choice"]);
	  if (empty($choice))
	  {
	     echo "<script language='javascript'>alert('选项内容不能为空!');history.go(-1);</script>";
	  }
	  else
	  {
	     link_data();
		 $query1="update choice set choice='".$choice."',IsDefault='".$HTTP_POST_VARS["currents"]."' where id=".$HTTP_POST_VARS["ids"];
		 $result1=mysql_query($query1);
		 echo "<script language='javascript'>alert('修改成功!');history.go(-1);</script>";
	  }
   }
   else
   {
      top("修改选项内容");
      top1("请在下面修改当前选项内容");
      link_data();
      $query="select * from choice where id=".$HTTP_GET_VARS["id"];
      $result=mysql_query($query);
      $row=mysql_fetch_array($result);
?>
<form name="form1" method="post" action="">
  <table width="70%"  border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#000000">
    <tr>
      <td width="34%" bgcolor="#CCCCCC"><div align="center">选项内容
      </div></td>
      <td width="66%" bgcolor="#FFFFFF"><input name="choice" type="text" class="inputs" id="choice" value="<?=$row["choice"];?>" size="30"></td>
    </tr>
    <tr>
      <td bgcolor="#CCCCCC"><div align="center">是否默认</div></td>
      <td bgcolor="#FFFFFF">
	  <?
	  if ($row["IsDefault"]=="a")
	  {
	  ?>
        <input type="radio" name="currents" value="a" checked>
<input type="radio" name="currents" value="b">
<?
}
else
{
?>
<input type="radio" name="currents" value="a">
<input type="radio" name="currents" value="b" checked>
<?
}
?></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td colspan="2"><div align="center">
        <input type="submit" name="Submit" value="提交">&nbsp;&nbsp;
        <input type="reset" name="Submit2" value="重置">
        <input name="actions" type="hidden" id="actions" value="1">
        <input type="hidden" name="ids" value="<?=$HTTP_GET_VARS["id"];?>">
</div></td>
    </tr>
  </table>
</form>
<?
}
}
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -