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 Link to comment https://forums.phpfreaks.com/topic/31622-solved-php-error/ 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 Link to comment https://forums.phpfreaks.com/topic/31622-solved-php-error/#findComment-146574 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. Link to comment https://forums.phpfreaks.com/topic/31622-solved-php-error/#findComment-146616 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? Link to comment https://forums.phpfreaks.com/topic/31622-solved-php-error/#findComment-146623 Share on other sites More sharing options...
Renlok Posted December 23, 2006 Author Share Posted December 23, 2006 it did :D Link to comment https://forums.phpfreaks.com/topic/31622-solved-php-error/#findComment-146633 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.