問題在哪裏?然後我打開我的/ localhost顯示消息「解析錯誤:語法錯誤,意外的T_STRING在...」中的.PHP 也許代碼不正確?解析錯誤:語法錯誤,意外T_STRING
<?php
if($_POST) {
$name = $_POST['news_name'];
$content = $_POST['news_text'];
$handle = fopen ("z_padomi_ka_atmest_smekesanu.php","a");
fwrite($handle,"<b>".$name."</b>:<br/>".$content."<br/>
fclose($handle);
}
?>
<script type="text/javascript">
document.getElementById('com-form').action = "z_padomi_ka_atmest_smekesanu.php";
</script>
<form action = "" method="post">
<p class="left"><label for="news_name"><b>Vārds:</b></label><br/><input type="text" name="news_name" id="news_name" value="" size="15" class="input big8"></p>
<p class="even"><label for="news_text"><b>Pievienot atbildi:</b></label><br/><textarea name="news_text" id="news_text" cols="75" rows="3" wrap="virtual"></textarea></p>
</p><p class="buttons right"><input id="add" type="submit" value="Pievienot" class="submit"><br>
<li><a style="text-decoration: underline; padding-right:10px; padding-top:5px" href="pamaciba.html" target="_blank">Komentāru noteikumi</a></p>
</form>
<?php include "z_padomi_ka_atmest_smekesanu.php";
</script>
看看fwrite調用的結尾,您忘記了結束函數調用,並且字符串缺少結束引號。 – jbub