Using PHP for Website Navigation, Explained. Get the Trellian Seo Toolkit
Get our FREE SEO Guide
Subscribe to our newsletter to receive useful SEO tips, tricks, strategies, free ebooks that are available only to our subscribers and get this amazing SEO guide for free!

Your email is safe and will NEVER be shared with any other parties. And of course, you can unsubscribe at any time.

Name:
Email:
SEO Elite - #1 SEO Software

Who Else Wants To Finally Get A #1 Google Ranking In As Little As 7 Days... And Drive A Minimum Of 789 Unique Visitors To Your Websites Per Day?

The Affiliate Marketers Toolkit - Master Resell Rights

This incredible tool is actually 3 tools in one, and they’re the quickest and easiest way to affiliate market. Inside this magnificent tool is absolutely everything you need to start increasing your click rate and raking in the big bucks!

Only $4.95
Coming soon ...


Self SEO Store  
SEO forum
Website templates
Flash templates
Best hosting reviews.
Free Internet & IT Magazines.
Articles archive

Submit your article

Register
Login

Search
XML news feeds
Free RSS news reader
Contact


AddThis Feed Button

Using PHP for Website Navigation, Explained.

Posted by Craig Freshwater on: 2006-04-17 00:19:21

Self SEO > Web Development Articles


PHP can be very useful in your webiste design, I use PHP for my websites difficult functions such as forums, blogs, chat, user forms, and shopping cart interface. But did you know you can use simple PHP for your website navigation systems?


The use of PHP for your websites header, left side navigation, and bottom of page information can be a great asset. Now I know what you are thinking, PHP can be complicated and intimidating to many of you, but first let me explain.
Using simple PHP include commands is a method any webmaster at any expertise level from novice to expert can implement with ease.

Most find editing PHP a frightening endeavor, but never fear, I will show you how.

A lot of us still use tables when designing our web pages instead of CCS, below is a veiw of the basic setup I will be discussing in this article:

Go here to see Image http://www.newcybertech.com/images/Artica1.jpg

As you can see from the image above, all the content surrounding the main content of each page will be shown in PHP and this is what this article is all about. The benefit of this technique will be when you update any of the surrounding PHP files, the results will be reflected on every page on your website that you have setup in this fashion. This sounds great right, but hold on, there is one more benefit.

You may say the same thing can be accomplished with robot include commands, but there is a catch to that.

The problem with the robot include command is that this content can not be seen by search engine robots. We all know that content is king to achieving high search engine rankings, so why hide the content you have? That’s why what I am about to teach you and using PHP for your website navigation is so important.

“All the information and links included in your navigation PHP can be seen and indexed by all the search engine robots for higher rankings.”

Now on to how it all Works:

Please read below if you need this information, if not browse down to the steps to generate PHP navigation on your website.

PHP: Hypertext Preprocessor, better known as PHP, is a highly popular, server-side scripting language that can be embedded directly into HTML coding.PHP can do anything that CGI can do, such as process form data and auto generate dynamic content, but PHP can do much more.It can be used on all major operating systems and supports most web servers.PHP is used by inserting PHP code inside your web page’s HTML code. When the page is called, your server automatically executes the code. What’s more, your visitors don’t need any special plug-ins for the code to run, as it will be displayed just like your HTML coding.As PHP is a server-side scripting language, although your visitors will not need to install any new software, PHP must be set up on your server.

Following is a very simple script that will test your server to ensure PHP is installed. It is a standard PHP function called phpinfo, which instructs the browser to print out information in regard to the set up of your server.

To use the script, simply copy the following three lines of code and paste them into a plain text editor, such as Note Pad.

< ?
phpinfo();
?>

Save the file as phpinfo.php and upload it to your server where you store your HTML files.

To run the script, simply point your browser to the script address. It should look something like this:

http://www.yourdomain.com/phpinfo.php

If PHP is installed on your server, you will be presented with a page of information about the PHP installed on your server.

If PHP isn’t installed, you will be prompted to download the file. In this case, you’ll need to contact your web host and ask them to install it, as it is free to download and install.

You can learn more about PHP and download it at

http://www.php.net/

Steps to generate PHP navigation on your website.

First of all you need to enable create a php file with html includes using the php include function. This is easily done by adding one line to your .htaccess file for your apache driven site and have php parsed in html files. To do this logon to your websites FTP account, go into the .htdocs file, find the .htaccess file, edit it to add this one line of code to the file:

AddType application/x-httpd-php .php .html

With that, you can have php blocks parsed in your html files so long as you put the php code in php tags. Example below:

php Code:
<--- ?phpinclude("somefile.php");? --->

We will get into how to use the above command a little later in this article .
Now on to the steps:

Step 1.
Build the the following pages in your favorite HTML editor:
A. header.html
B. left.html
C. bottom.html
D. right.html (optional)
Or you can name these files what ever you like, but I will be referencing them as the above for this article. Once you have these pages built to your liking, we now start implementing with PHP. First build a new Index.html page, you can name it TEST or something until you get it the way you want it. Set it up with tables to look like the page below:

Go here to see Image http://www.newcybertech.com/images/Artica2.jpg

Step 2. Now here is the trick, rename each HTML page you just built, “header.html, left.html, bottom.html, and right.html (optional)” to the .php file extension. You can do this by opening each .html file in a text file editor such as Notepad and save as .php to the same directory as the .html files on your server. You will now have a copy of each file in HTML and PHP format.

Step 3. We are now ready to use the new PHP files, in each table around your main content we will insert the <--- ?phpinclude("somefile.php");? ---> Command functions.
See example below:

Go here to see Image http://www.newcybertech.com/images/php.jpg

Step 4. Open your new index page in your favorite browser and you will now see all the HTML pages you built come together as one page by using PHP.

Go here to see Image http://www.newcybertech.com/newcybertech.jpg

Step 5. Editing the new PHP navigation pages is easy, all you need to do is edit the HTML file you built in you favorite HTML editor. When your are done just copy the pages HTML and then paste it into the corresponding PHP file. To do this open the PHP file with a text editor and replace the HTML with in it with the edited version of HTML and save it as .php again. Now your PHP file is updated to match your edited HTML file.

In conclusion:
Now when ever you update your website header and navigation pages the results will be reflected on every page on your website that you have setup in this fashion. And as a added bonus all the information and links included in your navigation PHP can be seen and indexed by all the search engine robots for higher rankings.

You have permission to publish this article electronically, in print, in your ebook or on your web site, free of charge, as long as the author bylines are included.

About the Author:Craig Freshwater is the Webmaster/CEO for http://www.newcybertech.com covering Webmaster Resources, Web Site Promotion, Search Engine Optimization, Web Design and Profit.Visit The Newcybertech Weblog http://www.newcybertech.com/Blog And Newcybertech http://www.newcybertech.com/Phorum/index.php for more great resources and articles.





Print this article    Tell a friend
Related Articles

User comments:

itsmekap - Posted on: 2011-03-15 08:27:09

Nicely explained the article i like your words...

SEO Company India SEO India Buy Car Delhi


gwopkid - Posted on: 2011-05-26 23:45:15

seo is so important.
adsense alternatives
create a blog
ppc advertising

abrahambonds - Posted on: 2011-08-06 13:21:33

I had really enjoyed for this info in this blog and helpful info in this blog. I am very much satisfied by the info in this blog. Thanks a lot for sharing the nice info in this blog.
WebHostingPad Reviews

Graham77 - Posted on: 2011-08-06 14:25:23

Sometimes PHP can be really annoying but such articles as yours are really motivational. They are keeping me working with that damn code. Thanks for that. Oh and keep posting such nice articles in the nearest future here too.
Regards, Graham from viagra generico online

markfort11 - Posted on: 2011-08-11 13:19:30

This website is providing the lot topics are visible in this blog that to concept wise visible in this blog. Thank you very much for providing the nice thing in this website. I had really like this technology in this blog how to become doctor

lilycollins - Posted on: 2011-09-10 13:14:23

I agree with this article but other language also useful, many Internet Marketing Company or Online Marketing Company (Seo Services )

scottas - Posted on: 2011-09-20 09:30:54

This is really admired for the nice info is visible in this blog that to using the amazing articles in this blog. Read this info by providing those articles and using the simple language in this website. This is really superb info is visible in this blog that to sharing the amazing technology is visible in this blog. Thanks a lot for providing the great services in this blog and keep it rocks
How To Become A Licensed Social Worker
How To Become A Supermodel
How To Become A Fighter
How To Become A Flight Attendant
How To Become Detective Or Criminal Investigator
How To Become An Ordained Minister
How To Become A Referee
How To Become A Stuntman
How To Become A Coach
How To Become An Actor
How To Become A Professional Boxer
How To Become A Medicare Provider
How To Become A Mentalist
How To Become A Navy Pilot
How To Become A Court Reporter


gramesmith - Posted on: 2011-09-27 12:05:30

I am really satisfied Receptionist by the nice services in this blog and the nice technology is visible in this blog. This is really very happy for providing the amazing CNA services in this blog and Accountant great servicesin this blog I had really impressed with this blog Job Descriptions Now and the great technology is visible in this website

samhann7 - Posted on: 2011-10-14 13:38:24

This is providing the different articles are visible in this blog and the nice services display in this blog. Thanks a lot for sharing the nice info in this blog and using the nice technology in this blog
CASINO BLACKJACK BLOG
vegas 365 poker gambling reviews
CASINO RANKING ONLINE
blackjack best
365-poker-journals
333 casino world
winning poker
casino journal website
online casino blog journal
FIRE LAKE GRAND CASINO NOW

scottas - Posted on: 2012-01-06 06:02:42

This casino cardgames online is a very good casino video poker guide articles are visible in this blog that to way presentation is really very great for the blackjack dealer nice info in this blog. I free casinogames online no download really like it very much for the nice services in this blog. This is very happy casino games slot machines for the great play casino roulette services in this blog. I am big fan of this website and the nice technology is visible in casino nodeposit now this blog. Thanks a lot online casinos for real money for sharing casino games online free the nice casino blackjack rules info in this blog.
Post New Comment

This site does not allow anonymous comments. Registered members can login to participate. Registration is free and takes only a few seconds