<form name="form1"/>
<input type="text" name="code1" value="D50" size="7" maxlength="10" onblur="chkidpro(this.value,'provider1');" />
<input type="text" name="code2" value="" size="7" maxlength="10"/>
<form/>
<script type="text/javascript">
var jvalue = form1.code1.value;
<?php $abc = "<script>document.write(jvalue)</script>"?>
</script>
<?PHP $con = mysql_connect("localhost","abc_one","PASS");
mysql_select_db("abc_one", $con);
$c= "D50";
$jval = $abc;
$result2 = mysql_query("SELECT * FROM tblprocode where code='". $c."';");
$tab = mysql_fetch_array($result2);
$fld1 = $tab['card'];
mysql_close($con);
?>
<?php echo $jval; ?>
<?php echo $fld1; ?>
如果我替换 $result2 = mysql_query("SELECT * FROM tblprocode where code='". $jval."';");
<?php echo $abc; ?> // its print as D50
<?php echo $jval; ?> // its print as D50
<?php echo $fld1; ?> // its not print, its blank
如果我替换 $result2 = mysql_query("SELECT * FROM tblprocode where code='". $c."';");
<?php echo $abc; ?> // its print as D50
<?php echo $jval; ?> // its print as D50
<?php echo $fld1; ?> // its print record data
请帮帮我什么错?
答案 0 :(得分:0)
我认为您应该使用trim
函数$jval = trim($abc);