Archive for the ‘Server-Side’ Category

How Can I Include Files in my Web Page?

Tuesday, March 31st, 2009

Including Files Using PHP

To include specific files into your webpage, you can use something like a PHP include() if your files are .php files or if you have your server set to handle whatever extension you are using as a PHP file.

Just insert the code into the part of the webpage you would like to include ‘name-of-file.php’ and it will automatically be inserted into the webpage when requested. (Note: ‘name-of-file.php’ must be located in the same directory as the file including/calling it, or else you must state the directory it is in: such as ‘news/name-of-file.php’ or ‘../name-of-file.php’ if it is one directory lower than the one currently in. You could also use absolute linking: http://www.domain.com/name-of-file.php.

Server Side Includes

Another thing you can try is Server-Side Includes. A server side include looks like and can be placed in the same manner as above, anywhere in your html (or whatever) file that you would like the included file to be displayed.

Includes are a great way to display something like a sidebar on every page for something that doesn’t need to be changed for every page. It will save you plenty of time.

What is PHP Programming Language?

Saturday, March 28th, 2009

PHP stands for Hypertext Preprocessor (don’t worry, there won’t be a quiz on this!).  PHP is a programming language for websites, that communicates with the server (Apache) and parses information returning it as HTML (or so you can display it as HTML).

PHP allows you to echo something that is dynamic or changing (like a date) unto a static html page (which doesn’t change).   So rather than having to change the date on a static normal html page every single day, you could just make a PHP script to echo the date for you (and it would always be updated, granted the server is up to speed).

PHP is not seen by the user, but only by the admin of the site when viewing the code of the webpage.  When viewed in a browser by a visitor to the site, the PHP code is first processed by the Apache server, and then outputted to the browser along with the HTML code, which can be mixed with PHP on a single page.  Most PHP webpages have the .php extension, but servers can be set up to parse other extensions (.htm, .html, etc.) as PHP also (using Handlers).


SEO Powered by Platinum SEO from Techblissonline