Jump to content

[SOLVED] php error


Renlok

Recommended Posts

ive tryed to make a chat box im getting the error
[i]Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/renlok/public_html/roe/chat.php on line 19[/i]

the code for it is:
[code]
<?php
include("header.php");

if (!isset($_COOKIE['mysite_username'])) die("You are not logged in!");
$mysite_username = $HTTP_COOKIE_VARS['mysite_username'];
$userid = $row['id'];
  $query = "SELECT * FROM chat";
  $result = mysql_query($query);
  $chat_header =<<<EOD
  <center><table id="chatbox" width="75%" border="1">
  <tr>
    <td width="78%">Post</td>
    <td width="22%">Posted</td>
  </tr>
  EOD;
  while($chat = mysql_fetch_array($result))
  {
$message = $chat['message'];
$user = $chat['user'];
$time = $chat['time'];
$chat_messages .=<<<EOD
<tr>
    <td>$message</td>
    <td><font size=2>$user</font><br><font size=1>$time</font></td>
    </tr>
EOD;
}
$chat_footer ="</table>";
$chat =<<<CHAT
$chat_header
$chat_messages
$chat_footer
CHAT;

echo '<p>post<br>';
echo '<form name="form1" method="post" action="posted.php">
  <textarea name="message" id="post"></textarea>
  <br>
  <input type="submit" name="Submit" value="Post">
</form></center>';

include("footer.php");
?>
[/code]

Thanks in advance for any help
Link to comment
https://forums.phpfreaks.com/topic/31622-solved-php-error/
Share on other sites

This took a little research but it appears that your problem is with the closing EOD; tag. It needs to occupy the first column of the line it's on. In other words, don't indent it. Push it all the way left.

Here's the reference on this from PHP.net:

http://us2.php.net/types.string
Link to comment
https://forums.phpfreaks.com/topic/31622-solved-php-error/#findComment-146574
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.