我是php的初学者,我想要正确回应这个,但错误说[重复]

This question already has an answer here:

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

I want to echo my post in my wall if it has a content to post but if the length of my textarea is <0 or above to 160 I want to echo an error then redirect to same page. But if it has a content I want to echo that messages.

<?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                                  
</div>

This should fix the issue:

<?php $strQuery = "SELECT * FROM freedom_wall ORDER BY id DESC"; ?>
<?php if ($hQuery = $objConnection->query($strQuery)): ?>
    <?php while($row = $hQuery->fetch_assoc()): ?>
        <?php $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 { 
                echo   "<br><h4>" . $row['username'] . "</h4>
                <p><h4>" . $row['post_msg'] . "</h4>
                <a href='" . $link_address . "'>" . $row["post_file"] . "</a>
                </p>";

            }
        ?>
    <?php endwhile; ?>
<?php endif; ?>

You have not closed curly braces of all starting curly braces. Use below code that I have fixed for you.

<?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>";

    }
}
}
?>