Need help with parse error. - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Need help with parse error.

kylmakorpikylmakorpi Posts: 5Member
I am trying to make a message system for my website, which works on the same basis as ShoutBox, but is simpler. Unfortunately, after writing the code, my server informed my that there was an unexpected T_STRING at line 28. Please could someone explain what exactly this is and what I am doing wrong.
[hr]
[code]<?php

extract($_POST);

if($submit){
if(!$name) die("Please enter a name.");
if(!$msg) die("Please enter a message");

$handle = fopen("messages.inc","r+");

$date = strftime("%T, %D");

$msg = str_replace(":)","<img src='img/happy.gif' />",$msg);
$msg = str_replace(":(","image",$msg);
$msg = str_replace(":#","image",$msg);
$msg = str_replace(")","image",$msg);
$msg = str_replace(":D","image",$msg);
$msg = str_replace("O)","image,$msg);

$data = $name."|".$msg."|".$date;

fwrite($handle,$data);
fclose($handle); }

?>









Name: |
Msg: |
image
image
image
image
image |
|





<?php

$msgs = file('messages.inc');
krsort($msgs);

foreach($msgs as $sbox) {
list($name,$msg,$date) = explode("|",$sbox);
echo $name.": ".$msg." - ".$date; }

?>

[/code]
[hr]
Any help will be greatly appreciated. :-)

Comments

Sign In or Register to comment.