Forum Moderators: coopster

Message Too Old, No Replies

Parse error: parse error, unexpected T_VARIABLE

         

maxinquaye

8:59 pm on Jul 12, 2005 (gmt 0)

10+ Year Member



Hey folks, I don't know a thing about PHP and got myself into a jam while fixing a friends site!

I get this error: Parse error: parse error, unexpected T_VARIABLE in /home/sweetn84/public_html/modules/coppermine/index.php on line 115

CODE:
if ($level > 1) get_subcat_data($subcat['cid'], $cat_data, $album_set_array,s/sp $level -1, $ident . "<img src=\".$CPG_M_DIR./images/spacer.gif\" width=\"20\" height=\"1\">");

Can someone help me fix?

Thanks much!
Peter

JamShady

10:33 pm on Jul 12, 2005 (gmt 0)

10+ Year Member



The "s/sp" is the problem

maxinquaye

10:57 pm on Jul 12, 2005 (gmt 0)

10+ Year Member



Thanks for replying. I put quotes around that but still get the same error. Is there a way to attach a file here?

coopster

10:35 am on Jul 13, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, maxinquaye.

No, no file attachments here, but you have already provided enough information to help resolve your problem. That function call must pass valid parameters. What is the function, get_subcat_data, expecting to receive as that particular parameter? Is it expecting the s/sp concatenated to one less than the $level variable? Is it expecting an entire string?

..., 's/sp' . $level - 1", ... 
OR
..., "s/sp $level -1", ...

maxinquaye

1:03 pm on Jul 13, 2005 (gmt 0)

10+ Year Member



Thanks Coopster-

I really have no idea when it comes to this type of scripting...all I know is I screwed up some code! I was working with this last night and chased errors for hours, currently getting this:

Parse error: parse error, unexpected $ in /home/sweetn84/public_html/modules/coppermine/index.php on line 508

Line 508 is my last line of code:
?>

From what I have read it could be a missing or extra bracket along the way so I am attempting to figure it out..is this correct? Definitely not my area...I'll supply the code if anyone feels challanged. Also, Can someone reccomend a text editor that may point out error to a newbie?

Thanks much,
Max.

Angelis

1:05 pm on Jul 13, 2005 (gmt 0)

10+ Year Member



If you get an unexpected $ error at the end of the code its possible you have missed one curly bracket out somewhere

} <- One of them

Just try putting it at the end, if that doesnt work you may have to go through the entire script.