下面的表格没有给 MySQL 表“contest”的第四个字段加分。
我找不到代码有什么问题。我错过了一些明显的东西吗?
echo '<form action="http://www.website.com/folder/file.php" method="post">
<input type="hidden" value="'.$u.'" name="u">
<input type="hidden" value="'.$profile.'" name="profile">
<input type="hidden" value="'.$profileid.'" name="profileid">
<div class="friend2title"><label for="url">Add points:</label></div>
<div class="friend2field"><input name="state" type="text" id="state" maxlength="150"></div>
<div class="addresssubmit"><input name="submit" type="submit" value="Add"></div>
</form>
';
然后,在http://www.website.com/folder/file.php:
$u = $_POST['u'];
$profile = $_POST['profile'];
$profileid = $_POST['profileid'];
$state = $_POST['state'];
$state = mysql_real_escape_string($state);
mysql_query("INSERT INTO contest VALUES (NULL, 'critic', '$profileid', '$state', NULL')");