Forum Moderators: coopster

Message Too Old, No Replies

Parse error: syntax error, unexpected T STRING

         

todayim

12:12 pm on Feb 16, 2008 (gmt 0)

10+ Year Member



Friends,
I am new to PHP and i am getting this Parse error: syntax error, unexpected T_STRING error in one of the files-
The error goes like this -
Parse error: syntax error, unexpected T_STRING in /includes/boxes/register.php on line 46

and the register.php file line no. 46 goes like this-

<tr><td align="center"><?php echo tep_draw_pull_down_menu('categories_id', tep_get_category_array_recursion(array(array('id' => '', 'text' => ' -- Select Age -- ')),''),$current_category_id,' style="width:150px" onChange="javascript:location.href='index.php?cPath='+document.getElementById('categories_id').value"'); ?>
</td></tr>

Can you help me out with this?

jatar_k

1:29 pm on Feb 16, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld todayim,

this portion has a bunch of mismatched quotes

' style="width:150px" onChange="javascript:location.href='index.php?cPath='+document.getElementById('categories_id').value"'

try this
<tr><td align="center"><?php echo tep_draw_pull_down_menu('categories_id', tep_get_category_array_recursion(array(array('id' => '', 'text' => ' -- Select Age -- ')),''),$current_category_id,' style="width:150px" onChange="javascript:location.href=\'index.php?cPath=\'+document.getElementById(\'categories_id\').value"'); ?>
</td></tr>

since the whole thing is surrounded by single quotes then single quotes inside of that need to be escaped by preceding them with \

[php.net...]

todayim

3:30 pm on Feb 16, 2008 (gmt 0)

10+ Year Member



@ jatar_k

Thanks a ton!
Its clean now.