-5
首先,我有這個。將文本框保存爲變量而不提交
<form method="post" action="<? echo $_SERVER['PHP_SELF']; ?>">
<input type="text" name="varenummer" id="varenummer" onkeyup="gethint(this.value)" hidden=true style="display:none">
</form>
再後來我有這個
if (isset($_POST['tryk'])) {
$pri = mysql_real_escape_string($_POST['pri']);
$sek = mysql_real_escape_string($_POST['sek']);
$dat1 = mysql_real_escape_string($_POST['dat1']);
$dat2 = mysql_real_escape_string($_POST['dat2']);
$dat3 = mysql_real_escape_string($_POST['dat3']);
$dato = $dat1 . "-" . $dat2 . "-" . $dat3;
$tek = mysql_real_escape_string($_POST['tek']);
$id1 = mysql_real_escape_string($_POST['id1']);
$varenummer = mysql_real_escape_string($_POST['varenummer']);
$insert = mysql_query("insert into Servicetxt (ID2, Servicenum, PriServiceTxt,
SekServiceTxt, Teknikker, Dato, Varenum) VALUES ('NULL', '$id1', '$pri', '$sek', '$tek',
'$dato', '$varenummer')")or die(mysql_error());
}
的事情是,在提交按鈕「tryk」放在一個Ajax網頁上。如何在isset($ _ POST ['tryk'])之前將文本框(varenummer)的值保存爲php變量,而不必按任何按鈕?
沒有設置沒有越來越.. –
請問爲什麼? –
什麼??????????????? –