-4

when i run file its appear with error

Parse error: syntax error, unexpected T_STRING, expecting ')' in /home/beddings/public_html/mybabystore.com.au/admin/categories.php on line 2364

here is my code

$contents[] = array(
    'align' => 'center', 
    'text' => '<br><a href="' . 
        tep_href_link(
            FILENAME_CATEGORIES, 
            '&cPath='. $cPath.'&cID='.$cID.'&checkall=1') 
        . '" onClick="setCheckboxes('mainForm', true); return false;">[Check All Products]</a>&nbsp;&nbsp;<a href="' 
        . tep_href_link(FILENAME_CATEGORIES, '&cPath='. $cPath.'&cID='.$cID) 
        . '" onClick="setCheckboxes('mainForm', true); return false;">[Un Check All]</a>'
);
4

3 回答 3

2

错误在这里,你需要转义你的单引号

setCheckboxes(\'mainForm\', true); 
              ^----------^
//You are using this twice so escape the other one too
于 2013-04-25T07:22:01.213 回答
0

试试这个:

$contents[] = array('align' => 'center', 'text' => '<br><a href="' . tep_href_link(FILENAME_CATEGORIES, '&cPath='. $cPath.'&cID='.$cID.'&checkall=1') . '" onClick="setCheckboxes(\'mainForm\', true); return false;">[Check All Products]</a>&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_CATEGORIES, '&cPath='. $cPath.'&cID='.$cID) . '" onClick="setCheckboxes(\'mainForm\', true); return false;">[Un Check All]</a>');
于 2013-04-25T07:24:07.890 回答
0

试试这个你需要转义单引号

$contents[] = array('align' => 'center', 'text' => '<br><a href="' . tep_href_link(FILENAME_CATEGORIES, '&cPath='. $cPath.'&cID='.$cID.'&checkall=1') . '" onClick="setCheckboxes(\'mainForm\', true); return false;">[Check All Products]</a>&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_CATEGORIES, '&cPath='. $cPath.'&cID='.$cID) . '" onClick="setCheckboxes(\'mainForm\', true); return false;">[Un Check All]</a>');
于 2013-04-25T07:18:38.717 回答