Parse error: syntax error, unexpected T_STRING

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
batjen
Forum Newbie
Posts: 1
Joined: Wed Jan 21, 2009 7:21 pm

Parse error: syntax error, unexpected T_STRING

Post by batjen »

Hallo!I am wondering if someone can give me a leg up on this error message I am getting when I run this script:

Parse error: syntax error, unexpected T_STRING in /home/shecard2/public_html/greetings/resource/richedit/show_it.php on line 56

Here are lines 56 and 57 of the code:

Code: Select all

$folder .="<td STYLE="cursor:hand;cursor: pointer" onClick="location.href='$script_url?what=$what&step=2&page=1&cat=$get_item';" onMouseover="this.style.backgroundColor='#C6D3EF';this.style.border='1px solid #3169C6'; " onMouseout="this.style.backgroundColor=''; this.style.border=''" align="center" height="27" >n";
$folder .="<font face=Verdana size=1>Category: <b>$get_item2</b></font><br><img align=absmiddle src=$folder_url/$get_item/$random_img_cat></td>n";
I didn't write this script, and the fellah that did is rather hapless when responding to help requests, so I am wondering if this is something simple that I can correct on my own.

Any help at all would be sincerely appreciated.

Thanks!
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Re: Parse error: syntax error, unexpected T_STRING

Post by Burrito »

you need to encapsulate your string on the second line you posted there in quotes and escape all of your double quotes everywhere.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Parse error: syntax error, unexpected T_STRING

Post by requinix »

This is why there's a "syntax highlighting" feature in many editors and IDEs:

Code: Select all

$folder .="<td STYLE="cursor:hand;cursor: pointer" onClick="location.href='$script_url?what=$what&step=2&page=1&cat=$get_item';" onMouseover="this.style.backgroundColor='#C6D3EF';this.style.border='1px solid #3169C6'; " onMouseout="this.style.backgroundColor=''; this.style.border=''" align="center" height="27" >n";
$folder .="<font face=Verdana size=1>Category: <b>$get_item2</b></font><br><img align=absmiddle src=$folder_url/$get_item/$random_img_cat></td>n";
Everything after the .= should be in red. Black is not good.
Post Reply