我的代码出了什么问题。无法传递文本输入值。
$('input').keyup(function(){
var val = $(this).val().trim().toLowerCase();
// from: https://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
//val.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
//from: https://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex
val = val.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
var re = new RegExp(val, 'ig');
console.log(re);
});
照片:
表结果:
$item1=$_POST['product'];
$item2=$_POST['id'];
foreach ($item1 as $k=>$get1){
$addsql = "insert into referral (product, ID) values ('$get1','$item2[$k]')";
$addresult = mysql_query($addsql, $link);
}
HTML:
Product ID
Liabilities null
Marine null
Medical 1
答案 0 :(得分:0)
最明显的问题是你所显示的HTML中没有$ _POST ['id'],只有$ _POST ['sub']和$ _POST ['product']。