欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

php實(shí)現(xiàn)保存submit內(nèi)容之后禁止刷新

 更新時(shí)間:2014年03月19日 16:03:16   作者:  
這篇文章主要介紹了php保存submit內(nèi)容之后禁止刷新的具體實(shí)現(xiàn),需要的朋友可以參考下
復(fù)制代碼 代碼如下:

$strsql = "INSERT INTO `xxx` (`aaa`) VALUES ('".$_POST["bbb"]."','".$_POST["ccc"]."',,now())";

$result=@mysql_query($strsql,$my_con);
$maxrow=@mysql_affected_rows();
Testecho ($y.mysql_affected_rows()." $errcode ".$strsql); #debug
mysql_sql_log($strsql,mysql_affected_rows(),$_SERVER['SCRIPT_NAME'].":".__LINE__);
if($maxrow>0){
$insertflag =1;
}

echo '<script>location.href="6612.php?inserted=1"</script>';

重點(diǎn)是最后一句,在insert完之后,重新載入一次頁(yè)面,并且加上參數(shù),然后在頁(yè)面上寫個(gè)判斷,又GET的參數(shù)并且為1的時(shí)候disabled。
復(fù)制代碼 代碼如下:

<?php echo $insertflag;print_r($_GET); if($_GET[inserted]!=1){?>
<input type="submit" value="新規(guī)登録" name="insertN" class="box1a"></input>
<?php }else{?>
<input type="botton" value="新規(guī)登録" name="insertN" class="box1a" disabled></input>
<?php }?>

相關(guān)文章

最新評(píng)論