【发布时间】:2018-08-26 05:08:01
【问题描述】:
Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting '-' or identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in C:\xampp\htdocs\project\homepage.php on line 235
如果我的帖子有要发布的内容,我想在我的墙上回显我的帖子,但如果我的 textarea 的长度为
<?php
//build query for displaying post messages
$strQuery = "SELECT * FROM freedom_wall ORDER BY id DESC";
// execute
if ($hQuery = $objConnection->query($strQuery)) {
//get data
while($row=$hQuery->fetch_assoc()){
$link_address = "files.php";
?>
<hr>
<?php
$postbody = $_POST['post_msg'];
if (strlen($postbody) > 160 || strlen($postbody) < 1) {
echo ("<script LANGUAGE='JavaScript'>
window.alert('Nothing to post!');
window.location.href='homepage.php';
</script>");
} else { //This is where I received the error i'm hard enough in using ' and " with concats
echo "<br><h4><?php echo $row['username']; ?></h4>
<p><h4><?php echo $row['post_msg']; ?></h4>
<?php echo '<a href='".$link_address."'>".$row["post_file"]."</a>';?>
</p>";
?>
Please help me
【问题讨论】:
-
无法在php标签内打开php标签。
-
我关闭了第一个 php 标签,然后打开了另一个 php 标签。否则你能告诉我那个标签在哪里吗?抱歉英语不好
-
在 echo 语句中使用字符串连接而不是打开和关闭 php 标签。 (php.net/manual/en/language.operators.string.php)
-
等一下先生,我去查一下