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

PHP獲取input輸入框中的值去數(shù)據(jù)庫比較顯示出來

 更新時間:2016年11月16日 14:48:44   作者:yangzailu1990  
這篇文章主要介紹了PHP獲取input輸入框中的值去數(shù)據(jù)庫比較顯示出來的相關(guān)資料,前端還算比較簡單,php后臺接受并查詢,本文給大家介紹的非常詳細(xì),具有參考借鑒價(jià)值,需要的朋友可以參考下

前端:

<!--商品查詢--> 
<input type="text" name="bianhao" value="" maxlength="10" size="10" style="width:100px; margin:0px 0px 0px 25px;height:20px;"/> 
<input type="submit" value="商品編號查詢" style="margin:0px 0px 0px 10px;cursor:pointer;background-color:#C30D23;border:0px;color:#FFFFFF;width:85px;border-radius:5px;padding:3px 0;font-size:13px;"/>

php后臺接收并查詢:

public function MallList(){ //寫方法
$goods=M('shop_goods_info'); //實(shí)例化數(shù)據(jù)庫對應(yīng)的表
$codes=I('param.bianhao'); //獲取前臺文本框數(shù)據(jù)
if(isset($codes) && $codes != ''){
$where['code']=$codes;
$this->assign('codes',$codes); //顯示
}
}
$info=$classify->where(array('code'=>$code))->find(); //查詢語法

2.或者:

有$_GET 或者 $_POST

<form action='' method='post'>
文本框:<input type='text' name='text'>
<input type='submit' value='提交',name='sub'>
</form>
<?php
if(!empty($_POST['sub'])){
echo $_POST['text'];
}
?>

如果是GET 就換成GET

以上所述是小編給大家介紹的PHP獲取input輸入框中的值去數(shù)據(jù)庫比較顯示出來,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評論