我在記事本中下面這段代碼wrinting和我保存在.html範圍內, 我想設計一個簡單的評論系統與數據庫(這是記事本)來保存評論,但是當我點擊提交按鈕時,apears在$_SERVER['PHP_SELF']
的特定命令中出現錯誤。你可以幫我嗎 ?使用php內部評論系統體內,並有結果上的錯誤
<html>
<body>
<div class ="forumform">
<form method="POST" action="<?=$_SERVER['PHP_SELF']?>">
name: <input type=text name="name" id="name">
comment: <input type=text name="commentcontent" id="commentcontent">
<button type="submit" value="submit" name="submit" class="btn">submit</button>
</form>
</body>
</html>
您是否嘗試過不使用短標籤? '<?php echo'代替'<?='' – samayo 2013-05-12 14:17:50
僅供參考,如果您不想使用htmlspecialchars()保護,請不要使用'__SERVER ['PHP_SELF']'易受XSS影響,行動= 「」' – 2013-05-12 14:24:15