whelpton Posted December 4, 2009 Share Posted December 4, 2009 Hi everyone, Ive been looking for a way of doing this for days now & I am completely stumped. Essentially, I want to have a footer, which is a php page, placed onto every single webpage that I create, or my users create on my site. I was looking for a way to do it with htaccess (http://www.trap17.com/index.php/Mod_rewrite-Htaccess_t36213.html) but that solution dosnt seem to work. Any ideas? Link to comment https://forums.phpfreaks.com/topic/183922-introducting-a-sitewide-footer/ Share on other sites More sharing options...
whelpton Posted December 4, 2009 Author Share Posted December 4, 2009 Perhaps php help is the wrong forum? Link to comment https://forums.phpfreaks.com/topic/183922-introducting-a-sitewide-footer/#findComment-970938 Share on other sites More sharing options...
minidak03 Posted December 4, 2009 Share Posted December 4, 2009 Put this on the page (or pages) where you want your footer to appear. <?php include_once('/path/footer.php'); ?> Then in your footer.php file place whatever code you want to use for your footer. Even if its a user generated page (Well depending on how you enable them to generate the pages) it's the easiest solution. Link to comment https://forums.phpfreaks.com/topic/183922-introducting-a-sitewide-footer/#findComment-970953 Share on other sites More sharing options...
whelpton Posted December 4, 2009 Author Share Posted December 4, 2009 Thanks for your help, however it is not a problem with including the footer on a single page, I want to automatically place it throughout the site, almost like geocities did with the side banner if you get my drift. Link to comment https://forums.phpfreaks.com/topic/183922-introducting-a-sitewide-footer/#findComment-970961 Share on other sites More sharing options...
trq Posted December 4, 2009 Share Posted December 4, 2009 there are a few mods for apache that can do this or you could simply use the auto_append_file directive within your php.ini. keep in mind though that most pages will already include the closing </body> and </html> tags, so you might need to workaround breaking pages. Link to comment https://forums.phpfreaks.com/topic/183922-introducting-a-sitewide-footer/#findComment-970966 Share on other sites More sharing options...
whelpton Posted December 4, 2009 Author Share Posted December 4, 2009 is there anyway of making the htaccess method work? Im on a shared server with my "sister" host & cannot affect apache/php config in a way that would affect them. Thanks Link to comment https://forums.phpfreaks.com/topic/183922-introducting-a-sitewide-footer/#findComment-970968 Share on other sites More sharing options...
Gayner Posted December 4, 2009 Share Posted December 4, 2009 is there anyway of making the htaccess method work? Im on a shared server with my "sister" host & cannot affect apache/php config in a way that would affect them. Thanks I also need help on this too, somone who is bright can help us? thx Link to comment https://forums.phpfreaks.com/topic/183922-introducting-a-sitewide-footer/#findComment-970970 Share on other sites More sharing options...
rajivgonsalves Posted December 4, 2009 Share Posted December 4, 2009 try this out, it will only work if your apache directive allowoverride is set to all for that directory php_value auto_append_file "[full path to file]" Link to comment https://forums.phpfreaks.com/topic/183922-introducting-a-sitewide-footer/#findComment-970973 Share on other sites More sharing options...
JAY6390 Posted December 4, 2009 Share Posted December 4, 2009 Could put these in the htaccess file php_value auto_prepend_file /path/to/header.php php_value auto_append_file /path/to/footer.php Link to comment https://forums.phpfreaks.com/topic/183922-introducting-a-sitewide-footer/#findComment-970974 Share on other sites More sharing options...
whelpton Posted December 4, 2009 Author Share Posted December 4, 2009 Legend guys, thank you very much! Link to comment https://forums.phpfreaks.com/topic/183922-introducting-a-sitewide-footer/#findComment-970975 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.