jwk811 Posted November 4, 2006 Share Posted November 4, 2006 this is weird.. im getting this error: Parse error: parse error, unexpected $on the very last line where it says </form>.. what could cause this Link to comment https://forums.phpfreaks.com/topic/26120-parse-error-parse-error-unexpected-arggggg-solved/ Share on other sites More sharing options...
doni49 Posted November 4, 2006 Share Posted November 4, 2006 Can you show us the code?My first guess would be that somewhere above that line, you forgot to close a string (missed a quote) or left off a semi-colon. Link to comment https://forums.phpfreaks.com/topic/26120-parse-error-parse-error-unexpected-arggggg-solved/#findComment-119444 Share on other sites More sharing options...
jwk811 Posted November 4, 2006 Author Share Posted November 4, 2006 ok its pretty long.. thats for looking over it! ;D Link to comment https://forums.phpfreaks.com/topic/26120-parse-error-parse-error-unexpected-arggggg-solved/#findComment-119447 Share on other sites More sharing options...
jwk811 Posted November 4, 2006 Author Share Posted November 4, 2006 i think it might be too long to fit Link to comment https://forums.phpfreaks.com/topic/26120-parse-error-parse-error-unexpected-arggggg-solved/#findComment-119448 Share on other sites More sharing options...
jwk811 Posted November 4, 2006 Author Share Posted November 4, 2006 i took this out to see if this was the problem and it was.. can you tell me whats wrong with this?[code]<?phpif (isset($_POST['optPayment'])) {$optPayment = $_POST['optPayment'];if ($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 = '';}} else { $paypal_checked = 'checked="checked"'; $cod_checked = '';?>[/code] Link to comment https://forums.phpfreaks.com/topic/26120-parse-error-parse-error-unexpected-arggggg-solved/#findComment-119451 Share on other sites More sharing options...
AndyB Posted November 4, 2006 Share Posted November 4, 2006 [quote author=jwk811 link=topic=113794.msg462728#msg462728 date=1162606361]this is weird.. im getting this error: Parse error: parse error, unexpected $on the very last line where it says </form>.. what could cause this[/quote]Symptomatic of an unclosed loop. If you indent every loop it makes it much easier to spot when you fail to close them., Link to comment https://forums.phpfreaks.com/topic/26120-parse-error-parse-error-unexpected-arggggg-solved/#findComment-119455 Share on other sites More sharing options...
doni49 Posted November 4, 2006 Share Posted November 4, 2006 a Link to comment https://forums.phpfreaks.com/topic/26120-parse-error-parse-error-unexpected-arggggg-solved/#findComment-119456 Share on other sites More sharing options...
doni49 Posted November 4, 2006 Share Posted November 4, 2006 [code]<?phpif (isset($_POST['optPayment'])) { $optPayment = $_POST['optPayment']; if ($optPayment == 'paypal') { $paypal_checked = 'checked="checked"'; } else if ($optPayment == 'cod') { $paypal_checked = '' ; } else { $paypal_checked = 'checked="checked"'; } if ($optPayment == 'cod') { $cod_checked = 'checked="checked"'; } else if ($optPayment == 'paypal') { $cod_checked = ''; } //<--I think I just found it.} else { $cod_checked = '';}[/code] Link to comment https://forums.phpfreaks.com/topic/26120-parse-error-parse-error-unexpected-arggggg-solved/#findComment-119458 Share on other sites More sharing options...
chimby Posted November 4, 2006 Share Posted November 4, 2006 It should read like this[code]<?phpif (isset($_POST['optPayment'])) { $optPayment = $_POST['optPayment']; if ($optPayment == 'paypal') { $paypal_checked = 'checked="checked"'; } else if ($optPayment == 'cod') { $paypal_checked = '' ; } else { $paypal_checked = 'checked="checked"'; }?><?php if ($optPayment == 'cod') { $cod_checked = 'checked="checked"'; } else if ($optPayment == 'paypal') { $cod_checked = ''; } else { $cod_checked = ''; }} else { $paypal_checked = 'checked="checked"'; $cod_checked = '';} //YOU WERE MISSING THIS BRACKET...?>[/code]you are missing the last bracket. Hope this helps Link to comment https://forums.phpfreaks.com/topic/26120-parse-error-parse-error-unexpected-arggggg-solved/#findComment-119459 Share on other sites More sharing options...
jwk811 Posted November 4, 2006 Author Share Posted November 4, 2006 YES THANK YOU VERY MUCH ALL AND CHIMBY IT WORKED. TYVM! Link to comment https://forums.phpfreaks.com/topic/26120-parse-error-parse-error-unexpected-arggggg-solved/#findComment-119470 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.