The program is PHP mysql. Everything is normal when running on Alibaba Cloud. After entering the customer code, other customer information is automatically retrieved from the database. The php version is 5.
After moving to the new server, the PHP version is 7, and nothing happens after entering the customer code.
The log only contains the following errors.
PHP Warning: implode(): Invalid arguments passed in /var/www/html/action.php on line 45
But I don’t think this is the reason
htmlSource code
<form id="form1" name="form1" method="post" action="action.php?act=add" onsubmit="return check( )">
<div class="hang_item"><span>Quotation No:</span><input name="danhao" type="text" id="danhao" size="60" readonly="readonly" value="<?=$ddh?>"/></div>
<div class="hang_tit">Customer Information< /div>
<div class="hang_item">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Customer No.:<span class="khxx"><input name="kehu" type="text" id="kehu" size="10" placeholder="" onblur="khxx(this)"/></span></td>
<td>Category:<span class="Category"></span></td>
<td>Grade:<span class="Grade"></span></td>
</tr>
<tr>
<td>Customer Name: <span class="khname"></span></td>
<td>Address: <span class="address"></span></td>
<td> </td>
</tr>
<tr>
<td>Contact Person: <span class="Person"></span></td>
<td>Email:: <span class="email"></span></td>
<td><span class=""></span></td>
</tr>
</table>
对应的JS代码
function khxx(obj){
khid=$(obj).attr("value");
//console.log(khid);
$.post("action.php?act=getKehu", { "khid": khid },
function(data){
//console.log(khid);
//$(obj).parents('tr').find('.pname').html(data.data[0].pname);
$(".Category").html(data.data[0].Category);
$(".Grade").html(data.data[0].Grade);
$(".khname").html(data.data[0].khname);
$(".address").html(data.data[0].address);
$("#d_address").val(data.data[0].address);
$(".Person").html(data.data[0].Person);
$(".email").html(data.data[0].email);
}, "json");
}
action.php
if($act=="getKehu"){
$sql_kh="select * from customer where CustomerNo='$khid'";
$result_kh=mysqli_query($GLOBALS['conn'], $sql_kh);
$info_kh=mysqli_fetch_array($result_kh);
$Category=$info_kh['Category'];
$Grade=$info_kh['Grade'];
$khname=$info_kh[2];
$address=$info_kh['Address'];
$Person=$info_kh['ContactPerson'];
$email=$info_kh['Email'];
echo '{"status" : 0 ,"msg" : "SUCCESS","data" :[{"Category":"'.$Category.'" ,"Grade" : "'.$Grade. '","khname" : "'.$khname.'","address" : "'.$address.'","Person" : "'.$Person.'","email" : "'.$ email.'"},{"id" : 2,"name" : "xiaoming"}]}';
}
I hope you can help me, thank you.
If the code problem is serious, you can get paid.
Warning: implode(): The parameters passed are invalid
Ntework reviews the parameters passed and prints $khid; and $info_kh, has the data been found? Make sure that the entered customer ID exists in the table.
*** Try to synchronize the environment with the test environment, one is 5 and the other is 7, there must be a difference