Renlok Posted December 22, 2006 Share Posted December 22, 2006 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]<?phpinclude("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 Quote Link to comment Share on other sites More sharing options...
simcoweb Posted December 22, 2006 Share Posted December 22, 2006 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 Quote Link to comment Share on other sites More sharing options...
Renlok Posted December 22, 2006 Author Share Posted December 22, 2006 oh, well thanks a bunch for putting the time to research into it ^^.i wonder why they cant be indented seems strange. Quote Link to comment Share on other sites More sharing options...
simcoweb Posted December 22, 2006 Share Posted December 22, 2006 Yeah, it is strange. But, did it fix the problem? Quote Link to comment Share on other sites More sharing options...
Renlok Posted December 23, 2006 Author Share Posted December 23, 2006 it did :D Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.