jwk811 Posted November 4, 2006 Share Posted November 4, 2006 ughhh im always having trouble with these brackets and getting this error: Parse error: parse error, unexpected '}' ... can you tell me whats wrong with this one? and the effected part is:[code]} else if ($optPayment == 'cod') { [/code] theres probably more but im not sure.. thats the first error anyways... any help would be great.. thank you![code]<?phpif ($optPayment == 'paypal') { $paypal_checked = 'checked="checked"' } else if ($optPayment == 'cod') { $paypal_checked = '' } else { $paypal_checked = checked="checked"' }?><?phpif ($optPayment == 'cod') { $cod_checked = 'checked="checked"' } else if ($optPayment == 'paypal') { $cod_checked = '' } else { $cod_checked = ''}?>[/code] Quote Link to comment Share on other sites More sharing options...
doni49 Posted November 4, 2006 Share Posted November 4, 2006 It's because you don't have any semi-colons to end the statements.[code]<?phpif ($optPayment == 'paypal') { $paypal_checked = 'checked="checked"';} else if ($optPayment == 'cod') { $paypal_checked = '' ;} else { $paypal_checked = 'checked="checked"';//<--you were also missing a quote here (after the first equal sign)}?><?phpif ($optPayment == 'cod') { $cod_checked = 'checked="checked"';} else if ($optPayment == 'paypal') { $cod_checked = '';} else { $cod_checked = '';}?>[/code]The semi-colon tells PHP that "this statement is ending". When you didn't show it, you got the error. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.