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] Link to comment https://forums.phpfreaks.com/topic/26113-help-me-place-these-brackets-pleaseparse-error-unexpected/ 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. Link to comment https://forums.phpfreaks.com/topic/26113-help-me-place-these-brackets-pleaseparse-error-unexpected/#findComment-119426 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.