zero-perfoliate
zero-perfoliate

Author Topic: Parse Error  (Read 789 times)

Offline R4nk3d

  • PHP Workers
  • **
  • Posts: 8
  • Karma: +0/-0
Parse Error
« on: July 27, 2008, 09:52:14 PM »
Code: [Select]
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/content/r/4/n/r4nk3d/html/staff.php on line 49
Code: [Select]
<?php
if(!file_exists("profiles/".$_GET['member']."/main.png"))
{
echo '<img src="images/no_photo.png" alt="This member has no photo." width="86" height="86" />';
}
else
{
//Line 49 echo "<img src="profiles/".$_GET['member']."/main.png" width="86" height="86" />";
}
?>
I have no clue why its doing this. Please help.

icestormz

  • Guest
Re: Parse Error
« Reply #1 on: July 28, 2008, 03:02:40 AM »
here is the working code

Code: [Select]
<?php
if(!file_exists("profiles/".$_GET['member']."/main.png"))
{
echo '<img src="images/no_photo.png" alt="This member has no photo." width="86" height="86" />';
}
else
{
       echo 
"<img src=\"profiles/".$_GET['member']."/main.png\" width=\"86\" height=\"86\" />";
}
?>

you are forgetting to escape quotes in echo's if you don't escape them you will get that error other then that the code was good.

Offline R4nk3d

  • PHP Workers
  • **
  • Posts: 8
  • Karma: +0/-0
Re: Parse Error
« Reply #2 on: July 28, 2008, 08:50:05 PM »
Alright, ill remember that for the future. thanks.

icestormz

  • Guest
Re: Parse Error
« Reply #3 on: July 28, 2008, 11:30:59 PM »
no problem glad to help

 

zero-perfoliate