Novice@PHP Posted March 8, 2010 Share Posted March 8, 2010 I'm new and looking a few pieces of advice in regards of coding. Firstly is the issue I'm having: Parse error: syntax error, unexpected $end in /home/martyharris/public_html/layout/header.php on line 172 It is something to do with this code. Note: My PHP Short Code in Php.ini is On. <?php header("Expires: Sat, 01 Jan 2000 00:00:00 GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", FALSE); header("Pragma: no-cache"); header("Content-Type: text/html; charset=iso-8859-1",TRUE); include(INCLUDES_DIR."/code/headertag.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <? $headertag_title = (($headertag_title) ? ($headertag_title) : (EDIRECTORY_TITLE)); ?> <title><?=$headertag_title?></title> <meta name="author" content="SisDir - Classificados" /> <? $headertag_description = (($headertag_description) ? ($headertag_description) : (EDIRECTORY_TITLE)); ?> <meta name="description" content="<?=$headertag_description?>" /> <? $headertag_keywords = (($headertag_keywords) ? ($headertag_keywords) : (EDIRECTORY_TITLE)); ?> <meta name="keywords" content="<?=$headertag_keywords?>" /> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="ROBOTS" content="index, follow" /> <? /* EDIRECTORY STYLES */?> <link href="<?=DEFAULT_URL?>/scripts/jquery/thickbox/thickbox.css" rel="stylesheet" type="text/css" media="all" /> <? if (EDIR_THEME) { include(THEMEFILE_DIR."/".EDIR_THEME."/".EDIR_THEME.".php"); } else { ?> <link href="<?=DEFAULT_URL?>/layout/general_structure.css" rel="stylesheet" type="text/css" /> <link href="<?=DEFAULT_URL?>/layout/preview.css" rel="stylesheet" type="text/css" /> <? } ?> <?=system_getNoImageStyle($cssfile = true);?> <? # ---------------------------------------------------------------------------------------------------- # * HEADER CONSTANTS # ---------------------------------------------------------------------------------------------------- // EXTRA STYLE SAMPLES // ONE CSS $extrastyle = DEFAULT_URL."/layout/xxx.css"; // TWO CSS $extrastyle = array(DEFAULT_URL."/layout/aaa.css", DEFAULT_URL."/layout/bbb.css"); if (EDIR_THEME) { } else { if (EDIR_THEME) { } else { if ($extrastyle) { if (is_array($extrastyle)) { foreach ($extrastyle as $extra_style) { echo "<link href=\"".$extra_style."\" rel=\"stylesheet\" type=\"text/css\" media=\"all\" />\n"; } } else { echo "<link href=\"".$extrastyle."\" rel=\"stylesheet\" type=\"text/css\" media=\"all\" />\n"; } } } ?> <? // SPECIFIC STYLESHEET TO MAC OS AND SAFARI BROWSER - FIX BUG WITH THE NAVBAR AND BUTTON if ((strpos($_SERVER['HTTP_USER_AGENT'], "Mac") !== false) or (strpos($_SERVER['HTTP_USER_AGENT'], "Safari") !== false)) echo "<link href=\"".DEFAULT_URL."/layout/general_macfix.css\" rel=\"stylesheet\" type=\"text/css\" media=\"all\" />\n"; ?> <? // SPECIFIC STYLESHEET TO LINUX OS - FIX BUG WITH THE NAVBAR if (strpos($_SERVER['HTTP_USER_AGENT'], "Linux") !== false) echo "<link href=\"".DEFAULT_URL."/layout/general_linuxfix.css\" rel=\"stylesheet\" type=\"text/css\" media=\"all\" />\n"; ?> <? /* EDIRECTORY THEME STYLESHEET */ ?> <link href="<?=DEFAULT_URL?>/layout/color/<?=LAYOUT_THEME_COLOR?>.css" rel="stylesheet" type="text/css" media="all" /> <? /* EDIRECTORY javascript */?> <script type="text/javascript"> <!-- DEFAULT_URL = "http://www.coolzones.net"; --> </script> <? /* EDIRECTORY Javascript */?> <script type="text/javascript"> <!-- DEFAULT_URL = "http://www.YOURWEBSITEHERE.com"; --> </script> <script src="<?=DEFAULT_URL?>/scripts/lang.js.php" language="javascript" type="text/javascript"></script> <script src="<?=DEFAULT_URL?>/scripts/common.js" language="javascript" type="text/javascript"></script> <script src="<?=DEFAULT_URL?>/scripts/location.js" language="javascript" type="text/javascript"></script> <script src="<?=DEFAULT_URL?>/scripts/advancedsearch.js" language="javascript" type="text/javascript"> </script> <script src="<?=DEFAULT_URL?>/scripts/contactclick.js" language="javascript" type="text/javascript"></script> <script src="<?=DEFAULT_URL?>/scripts/cookies.js" language="javascript" type="text/javascript"></script> <script src="<?=DEFAULT_URL?>/scripts/jquery.js" language="javascript" type="text/javascript"></script> <script src="<?=DEFAULT_URL?>/scripts/jquery/jquery.autocomplete.js" type="text/javascript"></script> <link href="<?=DEFAULT_URL?>/scripts/jquery/jquery.autocomplete.css" rel="stylesheet" type="text/css" media="all" /> <script src="<?=DEFAULT_URL?>/scripts/jquery/jquery.thickbox.js" type="text/javascript"></script> <script src="<?=DEFAULT_URL?>/scripts/review.js" language="javascript" type="text/javascript"></script> <link href="<?=DEFAULT_URL?>/scripts/jquery/thickbox/thickbox.css" rel="stylesheet" type="text/css" media="all" /> <link href="<?=DEFAULT_URL?>/layout/general_dynamic.php" rel="stylesheet" type="text/css" media="all" /> </head> <body> <div class="topNavbar"> <div class="wrapper"> <? include(EDIRECTORY_ROOT."/layout/langnavbar.php"); ?> </div> </div> <? include(EDIRECTORY_ROOT."/layout/subnavbar.php"); ?> <? if ((strpos($_SERVER["PHP_SELF"], "/".LISTING_FEATURE_NAME) !== false) || (strpos($_SERVER["PHP_SELF"], "claim.php") !== false)) { ?> <span class="isHidden" id="defaultURL"><?=DEFAULT_URL?></span> <? } ?> <? /* LAYOUT WRAPPER */ ?> <div class="wrapper"> <? /* HEADER */ ?> <div class="header" <?=system_getHeaderLogo();?>> <h1 class="logo"> <a href="<?=DEFAULT_URL?>/index.php" rel="nofollow" rel="nofollow" target="_parent" class="logoLink" title="<?=$headertag_title?>"><span><?=$headertag_title?></span></a> </h1> <? $banner = system_showBanner("TOP", $category_id, $banner_section); if ($banner) { ?> <div class="advertisement"> <div class="banner"><?=$banner?></div> <span class="advertisementLabel"><?=system_showText(LANG_ADVERTISER);?></span> <span class="advertisementLink"><a href="<?=((SSL_ENABLED == "on" && FORCE_MEMBERS_SSL == "on" && FORCE_ORDER_SSL == "on") ? SECURE_URL : NON_SECURE_URL)?>/order_banner.php?type=1"><?=system_showText(LANG_DOYOUWANT_ADVERTISEWITHUS);?></a></span> </div> <? } ?> </div> <? /* NAVBAR */ ?> <ul class="navbar"> <li><a href="<?=DEFAULT_URL?>/index.php" <?=((strpos($_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"], $_SERVER["SERVER_NAME"].EDIRECTORY_FOLDER."/index.php") !== false) ? "class=\"menuActived\"" : "")?>><?=ucwords(LANG_BUTTON_HOME);?></a></li> <li><a href="<?=LISTING_DEFAULT_URL?>/" <?=((strpos($_SERVER["PHP_SELF"], "/".LISTING_FEATURE_NAME) !== false) ? "class=\"menuActived\"" : "")?>><?=ucwords(LANG_LISTING_FEATURE_NAME_PLURAL);?></a></li> <? if (EVENT_FEATURE == "on") { ?> <li><a href="<?=EVENT_DEFAULT_URL?>/" <?=((strpos($_SERVER["PHP_SELF"], "/".EVENT_FEATURE_NAME) !== false) ? "class=\"menuActived\"" : "")?>><?=ucwords(LANG_EVENT_FEATURE_NAME_PLURAL);?></a></li> <? } ?> <? if (CLASSIFIED_FEATURE == "on") { ?> <li><a href="<?=CLASSIFIED_DEFAULT_URL?>/" <?=((strpos($_SERVER["PHP_SELF"], "/".CLASSIFIED_FEATURE_NAME) !== false) ? "class=\"menuActived\"" : "")?>><?=ucwords(LANG_CLASSIFIED_FEATURE_NAME_PLURAL);?></a></li> <? } ?> <? if (ARTICLE_FEATURE == "on") { ?> <li><a href="<?=ARTICLE_DEFAULT_URL?>/" <?=((strpos($_SERVER["PHP_SELF"], "/".ARTICLE_FEATURE_NAME) !== false) ? "class=\"menuActived\"" : "")?>><?=ucwords(LANG_ARTICLE_FEATURE_NAME_PLURAL);?></a></li> <? } ?> <li><a href="<?=PROMOTION_DEFAULT_URL?>/" <?=((strpos($_SERVER["PHP_SELF"], "/".PROMOTION_FEATURE_NAME) !== false) ? "class=\"menuActived\"" : "")?>><?=ucwords(LANG_PROMOTION_FEATURE_NAME_PLURAL);?></a></li> <li><a href="<?=DEFAULT_URL?>/advertise.php" <?=((strpos($_SERVER["PHP_SELF"], "/advertise.php") !== false) ? "class=\"menuActived\"" : "")?>><?=ucwords(LANG_MENU_ADVERTISE);?></a></li> <li><a href="<?=DEFAULT_URL?>/contactus.php" <?=((strpos($_SERVER["PHP_SELF"], "/contactus.php") !== false) ? "class=\"menuActived\"" : "")?>><?=ucwords(LANG_MENU_CONTACT);?></a></li> </ul> <? /* CONTENT */?> <div class="content"> <? include(EDIRECTORY_ROOT."/search.php"); ?> The other question I have is about developing without a hosting account. Is that possible? Quote Link to comment Share on other sites More sharing options...
Anti-Moronic Posted March 8, 2010 Share Posted March 8, 2010 It's a little messy. I'm finding it hard to find the problem. Generally, this error occurs when you have failed to end an enclosed block of code like: if(arg){ // do something ..without finishing the statement with } But, to answer your other question - yes, you can develop without a hosting account. Use wamp (for windows) or mamp (for mac) and you'll be running apache, php and mysql on your machine in no time. Quote Link to comment Share on other sites More sharing options...
sasa Posted March 8, 2010 Share Posted March 8, 2010 you don't close else block opened in line 58 Quote Link to comment Share on other sites More sharing options...
Novice@PHP Posted March 8, 2010 Author Share Posted March 8, 2010 you don't close else block opened in line 58 Where abouts do I put it? Thanks else { if (EDIR_THEME) { } else { if ($extrastyle) { if (is_array($extrastyle)) { foreach ($extrastyle as $extra_style) { echo "<link href=\"".$extra_style."\" rel=\"stylesheet\" type=\"text/css\" media=\"all\" />\n"; } } else { echo "<link href=\"".$extrastyle."\" rel=\"stylesheet\" type=\"text/css\" media=\"all\" />\n"; } } } Quote Link to comment Share on other sites More sharing options...
Anti-Moronic Posted March 8, 2010 Share Posted March 8, 2010 you don't close else block opened in line 58 Where abouts do I put it? Thanks else { if (EDIR_THEME) { } else { if ($extrastyle) { if (is_array($extrastyle)) { foreach ($extrastyle as $extra_style) { echo "<link href=\"".$extra_style."\" rel=\"stylesheet\" type=\"text/css\" media=\"all\" />\n"; } } else { echo "<link href=\"".$extrastyle."\" rel=\"stylesheet\" type=\"text/css\" media=\"all\" />\n"; } } } You need another bracket at the end of that block. Quote Link to comment Share on other sites More sharing options...
Novice@PHP Posted March 8, 2010 Author Share Posted March 8, 2010 Super stuff all is working again. Thank you. 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.