<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/platform.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d27423082\x26blogName\x3dMike\x27s+Marketing+Blog\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dBLUE\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttps://internetmarketinginsider.blogspot.com/search\x26blogLocale\x3den_US\x26v\x3d2\x26homepageUrl\x3dhttp://internetmarketinginsider.blogspot.com/\x26vt\x3d-6034577465143366741', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Thursday, June 22, 2006

Are you using PHP includes on your website?? You should. They are an amazing timesaver.

I'm not that into the whole technical part of it so I'll explain as best I can in English:

PHP includes are snippets of php markup that you add to the source code of your web page. When a user loads your page, the web server executes the include before loading the page to the users browser. This is the opposite of javascript in which the script itself is loaded to the browser and then it is executed.

The key to this in terms of SEO is that the search engine spiders will not see the PHP code, but instead will see the data is within it. This way you'll receive credit for the keywords and content that are in the include.

What do you use PHP includes for??

I use them for anything that I want to have across my site such as NavBars, Headers, Footers, even Adsense units. If I need to make a change, such as adding a new category to my NavBar, I only have to make the change once and it will update every page on the site.

How does it work??

Just create a simple text file in Notepad and add whatever info you would like to it. For example, lets say we are adding a Navbar. I'll save the file as navbar.txt.

Then, on the page you want the info to appear just add this bit of code:

< ?php include("navbar.txt"); ?>

This will automatically add whatever text you have saved in navbar.txt. And you can format the content the same way you would any other text.

Just one thing to remember...in order for the PHP code to work you have to save your web pages as PHP pages, not html. (index.php instead of index.html).

Use php includes wisely and you'll save yourself a lot of time. It also cleans up the source files, making them easier to edit.

0 Comments:

Post a Comment

<< Home