我试图为工作提供一个编辑器。它必须具有预览功能。有2种形式。第一个表单提交预览,第二个表单预览时出现,并发送变量将它们保存在数据库中。问题是,当提交第二个表单时,所有引号都消失了。我尝试了mysql_real_escape_string,htmlspecialchars,htmlentitles,但没有任何工作。你知道问题出在哪里吗? 难道是因为我用变量'$ content'来存储网站的内容,而不是直接用'echo'输出吗? 谢谢!PHP - 使用包含引号的变量输入隐藏字段
<td><input style='float:left;' type='submit' name='jobpreview' value='preview' />
</form>";
if(isset($_GET['preview']))
{
$_POST['titel'] = htmlentities($_POST['titel']);
$_POST['elm1'] = htmlentities($_POST['elm1']);
$content .= " <td><form action='?s=intern&sub=neuerjob&preview' method='POST'>
<input type='hidden' name='titel' value='".$_POST['titel']."' />
<input type='hidden' name='elm1' value='".$_POST['elm1']."' />
<input style='float:left;' type='submit' name='jobsave' value='save' />
</form></td></tr></table>";
}
请勿使用htmlentities函数。 – hjpotter92 2012-04-05 21:05:22