gpt4 book ai didi

php - 解析错误:syntax error, unexpected T_STRING

转载 作者:行者123 更新时间:2023-12-03 08:23:25 25 4
gpt4 key购买 nike

哪里有问题?然后,在我的/localhost显示消息“解析错误:语法错误,意外的T_STRING在...”中打开.PHP。
也许代码不正确?

<?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($handle,"<b>".$name."</b>:<br/>".$content."<br/>
fclose($handle);

对此
fwrite($handle,"<b>".$name."</b>:<br/>".$content."<br/>");
fclose($handle);

编辑

您也忘记了php关闭标签:
<?php include "z_padomi_ka_atmest_smekesanu.php";
</script>


<?php include "z_padomi_ka_atmest_smekesanu.php"; ?>
</script>

关于php - 解析错误:syntax error, unexpected T_STRING,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20166427/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com