所有代码是:
$(document).ready(function(){
$('#sub').click(function() {
var r = confirm("سلام")
if (r==true){
var in_code=document.getElementsByName("code")[0].value;
var echo="<?php
include ('conect.php');
$res2=mysql_query("select * from products where code=".echo('document.write(in_code);');." ");
$row2=mysql_fetch_array($res2);
echo $row2['name'];
?>"
alert(echo); }
else {
document.getElementById("frm1").reset();
}
在这一行错误中:
$res2=mysql_query("select * from products where code=".echo('document.write(in_code);');." ");
echo('document.write(in_code);'); 不工作
如何修复他的或它做得更好?