核心提示:? $stop = $_GET['stop']; $onoff = $_GET['onoff']; $linkid=@mysql_connect(localhost, root , 12345) or die(不能連接到數(shù)據(jù)庫服務(wù)器!可能是數(shù)據(jù)庫服務(wù)器沒有啟動,或者用戶名密碼有誤!); @mysql_select_db(ok_11,$linkid) or die(選擇數(shù)據(jù)庫出錯,可能是您指定的.....
創(chuàng)新互聯(lián)建站專業(yè)為企業(yè)提供日土網(wǎng)站建設(shè)、日土做網(wǎng)站、日土網(wǎng)站設(shè)計、日土網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計與制作、日土企業(yè)網(wǎng)站模板建站服務(wù),十多年日土做網(wǎng)站經(jīng)驗,不只是建網(wǎng)站,更提供有價值的思路和整體網(wǎng)絡(luò)服務(wù)。
?
$stop = $_GET['stop'];
$onoff = $_GET['onoff'];
$linkid=@mysql_connect("localhost", "root" , "12345") or die("不能連接到數(shù)據(jù)庫服務(wù)器!可能是數(shù)據(jù)庫服務(wù)器沒有啟動,或者用戶名密碼有誤!");
@mysql_select_db("ok_11",$linkid) or die("選擇數(shù)據(jù)庫出錯,可能是您指定的數(shù)據(jù)庫不存在!");
$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開關(guān)面板/title
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
scrip';
echo 't language="JavaScript"
!--
function Stopan(i) {
with(document.getDataForm){
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)"關(guān)閉/a
/body
/html';
?
總是提示SCRIPT ERROR!不知錯在哪里,初學(xué)者,不會請別見笑!謝謝指導(dǎo)!
--------------------------------------------------------------------------------
頂?。。。。?!
--------------------------------------------------------------------------------
?
if(isset($_GET['stop']) isset($_GET['onoff'])) {
$stop = $_GET['stop'];
$onoff = $_GET['onoff'];
$linkid=@mysql_connect("localhost", "root" , "12345") or die("不能連接到數(shù)據(jù)庫服務(wù)器!可能是數(shù)據(jù)庫服務(wù)器沒有啟動,或者用戶名密碼有誤!");
@mysql_select_db("ok_11",$linkid) or die("選擇數(shù)據(jù)庫出錯,可能是您指定的數(shù)據(jù)庫不存在!");
$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開關(guān)面板/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)"關(guān)閉/a
form name="test" method="GET" action="test1.php"
input type="hidden" name="stop"
input type="hidden" name="onoff"
/form
/body
/html';
?
直接 $name = $_POST
var_dump($name)
看有沒有數(shù)據(jù),沒有的話就是你的提交地址錯了
1.用html做出訂單數(shù)據(jù)錄入界面;
2.用form把訂單數(shù)據(jù)post給php處理;
3.用php接受訂單數(shù)據(jù)并驗證處理;
4.用php調(diào)用mysql函數(shù)將數(shù)據(jù)插入數(shù)據(jù)庫。