这是我收到的错误消息:
Parse error: syntax error, unexpected '"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/content/50/8492150/html/colejoh/web/ai/form.php on line 10
Run Code Online (Sandbox Code Playgroud)
对于我的HTML表单,我使用此代码:
<html>
<head>
</head>
<body>
<form action="form.php" method="post">
Search: <input type="text" name="term" /><br />
<input type="submit" name="submit" value="Submit" />
</form>
<body OnLoad="document.myform.query.focus();">
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
对于我的form.php代码:
<body>
<?php
$con = mysql_connect ("xxx.xxx.xxx.xxx", "user", "password");
mysql_select_db ("user", $con);
if (!$con)
{
die ("Could not connect: " . mysql_error());
}
$sql = mysql_query("SELECT * FROM ai WHERE key LIKE $_POST["term"];") or die
(mysql_error());
while ($row …Run Code Online (Sandbox Code Playgroud)