zero-perfoliate
zero-perfoliate

Author Topic: Parse error: syntax error, unexpected T_STRING  (Read 411 times)

Offline batjen

  • New PHP Members
  • Posts: 1
  • Karma: +0/-0
Parse error: syntax error, unexpected T_STRING
« on: January 21, 2009, 05:41:31 PM »
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:


$folder 
.="<td STYLE="cursor:hand;cursorpointer" 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!

Offline PhPHelper

  • http://Digiscapers.com
  • Full Member
  • PHP Problem Solvers
  • ****
  • Posts: 179
  • Karma: +50/-0
    • Bad Apple Mail
Re: Parse error: syntax error, unexpected T_STRING
« Reply #1 on: February 10, 2009, 05:51:51 PM »
Double quotes inside double quotes need escaping in php like this:

Code: [Select]
<?php
$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"
?>


That should work now.