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