<?
if(isset($_GET['stop']) && isset($_GET['onoff'])) {
$stop = $_GET['stop'];
$onoff = $_GET['onoff'];

$linkid=@mysql_connect("localhost", "root" , "12345") or die("不能连接到数据库服务器!可能是数据库服务器没有启动,或者用户名密码有误!");
@mysql_select_db("ok_11",$linkid) or die("选择数据库出错,可能是您指定的数据库不存在!"); $stop_query = "update tb_1 set $stop=$onoff";
$stop_result = @mysql_query("$stop_query",$linkid);
}
echo '<meta http-equiv="Content-Type" conten';
echo 't="text/html; charset=gb2312" />
<html>
<head>
<title>开关面板</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<scrip';
echo 't language="JavaScript">
<!--
function Stopan(i) {
with(document.test){
    st';
echo 'op.value = "stop_1";
    onoff.value = i;
    submit();
  }}
//-->
</scri';
echo 'pt>
</head>
<body>
<a h';
echo 'ref="JavaScript: Stopan(0)">打开</a> / <a href="JavaScript: Stopan(1)">关闭</a>
<form name="test" method="GET" action="test1.php">
<input type="hidden" name="stop">
<input type="hidden" name="onoff">
</form> 
</body>
</html>';
?>