Archadian Posted September 26, 2008 Share Posted September 26, 2008 Instead of writing the HTML code on every page how can i write 1 HTML page template and call it in the code to make up the page. Sorta like phpBB does it but not really...just 1 template file. Thanks Link to comment https://forums.phpfreaks.com/topic/125955-php-and-html/ Share on other sites More sharing options...
aebstract Posted September 26, 2008 Share Posted September 26, 2008 Read this article: http://alistapart.com/articles/phpcms It should provide you with the help you need. If you need further help with the code once you get started, I'm sure someone can help Link to comment https://forums.phpfreaks.com/topic/125955-php-and-html/#findComment-651302 Share on other sites More sharing options...
Archadian Posted September 26, 2008 Author Share Posted September 26, 2008 I don't even know where to begin to find what i need there but thank you Any ideas or websites would be great thanks. Link to comment https://forums.phpfreaks.com/topic/125955-php-and-html/#findComment-651308 Share on other sites More sharing options...
cunoodle2 Posted September 26, 2008 Share Posted September 26, 2008 Can you give a very small specific example? Are you referring to like using an include file? If so you could create a file with the .html extension and then just put this code on each page where you wanted it... <?php //include page with all formatting require_once "../../format.html"; ?> Link to comment https://forums.phpfreaks.com/topic/125955-php-and-html/#findComment-651312 Share on other sites More sharing options...
aebstract Posted September 26, 2008 Share Posted September 26, 2008 If you read from the top of that page to the bottom of it, it will explain what you need to know. I know it's a tough life, but you actually have to read it. Link to comment https://forums.phpfreaks.com/topic/125955-php-and-html/#findComment-651313 Share on other sites More sharing options...
Brian W Posted September 26, 2008 Share Posted September 26, 2008 include('templatefile.html') or, I like the idea of having one index page and when they click on a link, it creates a URL variable and then u use that variable to decide what content to include. like www.domain.com/?Page=Aboutus.php then, have $Page = "index.php" if(isset($_GET['Page'])) { $Page = $_GET['Page']; } include($Page) Also, CSS is really handy for templates. EDIT****** YOU WILL WANT MORE THAN THAT SCRIPT, SORRY... don't use what I just said. Someone can do some pretty bad stuff to your site if you use that... but you can use similar techniques with a few more lines of code and be safe. again sorry. Link to comment https://forums.phpfreaks.com/topic/125955-php-and-html/#findComment-651316 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.