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!


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.


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

$handle = fopen("","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;

fclose($handle); }


Name: |
Msg: |
image |


$msgs = file('');

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


Any help will be greatly appreciated. :-)


Sign In or Register to comment.