Welcome to the Graphic and Web Design Forum
your forum for all things Design
- » Graphic Design
- » Web Design
- » Logos and Branding
- » Illustration
- » Photography
- » Design Tutorials
- » Plenty of Off Topic Chat
Register now to remove this ad box
Thread: PHP Includes
04-01-2007, 07:44 AM #1
REGISTER TO REMOVE ADS
Well with PHP you can speed up many processes that you may do countless times..
first thing is create a config.php
$footer="Copyright 2007 Test Ltd";
<?php include("config.php"); ?>
<?php echo $companyname; ?>
I have found this method to save me a lot of time.. it can be used for anything and dont forget that any config.php cannot be opened in another page. if you navigate to this config file it will be blank! hiding your details!!
Its also a good idea to do includes for your menus etc.. so a simple include tag with the pure html or css to that menu no html needed in the include and you can change all pages with the same menu from one file.
23-01-2007, 05:03 PM #2
good information for those in need, however one thing I noticed.
Dont forget all files must be PHP extensions.
What Im saying is for example say you have a file at: yoursite.com/welcome.html
and that includes a file called: title.htm
now in the title.htm file you have some things you might now want to show, then you should use title.php.
Anyone who then types: yoursite.com/title.htm can see its contents whether it be code or not.
However, if that person types: yoursite.com/title.php, will only see stuff that is printed to the browser (stuff with for example) but other stuff wont show up
dont know if this was very clear but hope it was.
25-01-2007, 12:24 PM #3
maybe you didnt get the point.. its for dynamic content so that you can edit few lines of code on seperate pages within one file. so php extensions is needed or it wouldnt work. unless (doubt it) you have your server setup to use .htaccess files to modify mime type
25-01-2007, 05:15 PM #4
REGISTER TO REMOVE ADS
But my point about not having to use .php extension is still true, if its not dynamic or php content and you dont have .htaccess modified.
I often use a template such as the following:
makes it easier to make quick changes to a whole site especially with many pages.
Last edited by bluesage; 25-01-2007 at 05:25 PM.
By Harry in forum Programming ForumReplies: 11Last Post: 18-10-2007, 11:19 AM