php的isset(),PHP isset()具有多个参数
我正在嘗試使用AJAX自動(dòng)完成功能,并且我有兩個(gè)使兩種語(yǔ)言協(xié)同工作的問(wèn)題.
當(dāng)我僅使用1 $_POST替換所有的issets時(shí),下面的代碼片段將會(huì)起作用,但是通過(guò)添加另一個(gè)$_POST,我在第5行得到一個(gè)錯(cuò)誤.
require_once '../Configuration.php';
if (isset($_POST['search_term'] . $_POST['postcode']) == true && empty ($_POST['search_term'] . $_POST['postcode']) == false) {
$search_term = mysql_real_escape_string($_POST['search_term'] . $_POST['postcode']);
$query = mysql_query("SELECT `customer_name`,`postcode` FROM `Customers` WHERE `customer_name` LIKE '$search_term%' ");
while(($row = mysql_fetch_assoc($query)) !== false) {
//loop
echo '
',$row['customer_name'] . $row['postcode'] '';}
}
?>
任何關(guān)于為什么拋出這個(gè)錯(cuò)誤的建議將不勝感激.謝謝.
我明白我應(yīng)該使用mysqli,我只是想得到第一個(gè)邏輯:)
JS:
Primary.js:
$(document).ready(function() {
$('.autosuggest').keyup(function() {
var search_term = $(this).attr('value');
var postcode = $_GET['postcode'];
//alert(search_term); takes what is typed in the input and alerts it
$.post('ajax/search.php', {search_term:search_term, postcode:postcode}, function (data) {
$('.result').html(data);
$('.result li').click(function() {
var result_value = $(this).text();
$('.autosuggest').attr('value', result_value);
$('.result').html('');
});
});
});
});
總結(jié)
以上是生活随笔為你收集整理的php的isset(),PHP isset()具有多个参数的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: linux查看etl进程,常见ETL工具
- 下一篇: 动态规划算法php,php算法学习之动态