Web Design Tips

Archive for the 'PHP' Category

Web Design with PHP

For the uninitiated that have never heard of PHP, the good news is that it (PHP) may requires no more than to use instructions such as Includes() function to get your web design to run in a very smooth manner. For those who are hung up about splash pages, and a whole lot of links in their web pages, that made for less than attractive web sites, using PHP in web design is a boon since there are a number of benefits to its use.

If you have been brought up on the staple diet of splash pages, adding content to web pages and not having standardized or uniform pages, and adding links whenever new pages were added; PHP can be quite a revelation. Gone will be the tedium and slowness of manually changing your links every time you add new features, which even in the case of a small web site can be quite a chore.

The wonders of discovering PHP?s Includes() function can help you replicate your ideas where a single source is used for similar content on a number of different pages on your web site, and the Includes() function can also be placed anywhere on your web page. The Includes() function is not limited to just using it with menus and it is just as useful when using content that requires additions or updation on more than a single page and also when using Google analytics tracking code.

The only thing you need to understand is how to use the Include() function, which in any case is easy to learn. First off, you will need to create a file in which to put the content that requires to be replicated on different pages. And, in addition, you must ensure that the different web pages are given the extension of .php rather than the usual .html, and if you want to redirect people from an .html page to the .php page, you can make use of META tags.

The file that contains your code for the menu should be saved separately in a file and given a name that is easy to remember such as menu.php and then you can go to your original page and include code such as <php include(?name of your menu file. Php?); ?>. In this simple way you will find all your work done and the next time the page loads, the code that you have placed on it will then grab the content from your menu.php file and place it into the page at the place where you had placed the PHP code. All this is achieved so transparently that nobody that is viewing your web site will even gets a whiff of what is taking place in the background.

The beauty of using such PHP code in your web site is that you can simply edit and update your menu.php file and wherever on your web pages that code has been placed, the editing and updations will take affect automatically without your needing to spend time to dig up your various HTML and having to change your content manually.