jigsawsoul Posted March 20, 2010 Share Posted March 20, 2010 Whats would be the correct way to write this function? any help please thanks <?php function template ($content) { <?php include($config["paths"]["resources"] . '_template/header.php'); ?> <div id="header"> <div class="innerwaraper"> <?php include($config["paths"]["resources"] . '_template/top.cart.php'); ?> <?php include($config["paths"]["resources"] . '_template/nav.menu.php'); ?> </div> </div> <div class="bodybg"> <div id="containner"> <div id="leftbar"> <?php include($config["paths"]["resources"] . '_template/search.php'); ?> <?php include($config["paths"]["resources"] . '_template/nav.categories.php'); ?> <?php include($config["paths"]["resources"] . '_template/drop.manufacturers.php'); ?> <?php include($config["paths"]["resources"] . '_template/left.boxs.php'); ?> </div> <?php include($config["paths"]["resources"] . '_template/content.php'); ?> <div id="rightbar"> <?php include($config["paths"]["resources"] . '_template/nav.specials.php'); ?> <?php include($config["paths"]["resources"] . '_template/drop.reviews.php'); ?> <?php include($config["paths"]["resources"] . '_template/popular.tags.php'); ?> <?php include($config["paths"]["resources"] . '_template/right.boxs.php'); ?> </div> <div class="clear"> </div> </div> <?php include($config["paths"]["resources"] . '_template/footer.php'); ?> </div> </body> </html> } ?> Quote Link to comment https://forums.phpfreaks.com/topic/195945-whats-the-correct-way-to-write-this/ Share on other sites More sharing options...
peter_anderson Posted March 20, 2010 Share Posted March 20, 2010 What do you mean "right way"? Quote Link to comment https://forums.phpfreaks.com/topic/195945-whats-the-correct-way-to-write-this/#findComment-1029249 Share on other sites More sharing options...
jigsawsoul Posted March 20, 2010 Author Share Posted March 20, 2010 it contains errors, so i know i haven't included the html right, or within the functions, how would it be written correctly? is what i'm looking for thanks, Quote Link to comment https://forums.phpfreaks.com/topic/195945-whats-the-correct-way-to-write-this/#findComment-1029250 Share on other sites More sharing options...
ldb358 Posted March 20, 2010 Share Posted March 20, 2010 what kind of errors are you getting, whats not working? Quote Link to comment https://forums.phpfreaks.com/topic/195945-whats-the-correct-way-to-write-this/#findComment-1029254 Share on other sites More sharing options...
jigsawsoul Posted March 20, 2010 Author Share Posted March 20, 2010 error Parse error: syntax error, unexpected '.' in /home/jigsaws2/public_html/project/resources/_library/template.php on line 7 i've rewritten the code <?php function template ($content) { echo ' '.include($config["paths"]["resources"] . '_template/header.php');.' <div id="header"> <div class="innerwaraper"> '.include($config["paths"]["resources"] . '_template/top.cart.php');.' '.include($config["paths"]["resources"] . '_template/nav.menu.php');.' </div> </div> <div class="bodybg"> <div id="containner"> <div id="leftbar"> '.include($config["paths"]["resources"] . '_template/search.php');.' '.include($config["paths"]["resources"] . '_template/nav.categories.php');.' '.include($config["paths"]["resources"] . '_template/drop.manufacturers.php');.' '.include($config["paths"]["resources"] . '_template/left.boxs.php');.' </div> '.include($config["paths"]["resources"] . '_template/content.php');.' <div id="rightbar"> '.include($config["paths"]["resources"] . '_template/nav.specials.php');.' '.include($config["paths"]["resources"] . '_template/drop.reviews.php');.' '.include($config["paths"]["resources"] . '_template/popular.tags.php');.' '.include($config["paths"]["resources"] . '_template/right.boxs.php');.' </div> <div class="clear"> </div> </div> '.include($config["paths"]["resources"] . '_template/footer.php');.' </div> </body> </html> '; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/195945-whats-the-correct-way-to-write-this/#findComment-1029257 Share on other sites More sharing options...
jigsawsoul Posted March 20, 2010 Author Share Posted March 20, 2010 anyone ? Quote Link to comment https://forums.phpfreaks.com/topic/195945-whats-the-correct-way-to-write-this/#findComment-1029263 Share on other sites More sharing options...
ldb358 Posted March 21, 2010 Share Posted March 21, 2010 you dont need the ; after the include before the dot Quote Link to comment https://forums.phpfreaks.com/topic/195945-whats-the-correct-way-to-write-this/#findComment-1029656 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.