Ten Ways to Use PHP on your Website
25 viewsPHP is a programming language that allows your website to go beyond a basic HTML document, and create an interactive experience. Open source means that the source code is available to someone with proper access to the site, so that they can easily make changes. When the Internet was first getting started, most of the pages on websites were basic HTML documents. Meaning that when you visited a page (about.html, for example), you downloaded all of the content of the page into your browser.
How Do I Know if I have a PHP Site?
If you are visiting a site, and you see that the page name ends with .html, this means that the page is most likely a plain old HTML page. If the page name ends in .php, then you the site is a php based site. Other dynamic programming languages include .jsp (Java Server Pages) or .asp (.NET or Active Server Pages). Occasionally you’ll see sites that end in .html that have dynamic code embedded in them, but this requires some tricks to accomplish on the server.
We have several sites that use static HTML pages and have great results. There are some pages that have dynamic content, but most of the pages are built in straight HTML. It’s great for search engine optimization, as some of those pages have been active for years. However, as the number of pages grow, it becomes increasingly difficult to update menu or navigation items, because it means you have to open each page, one at a time, and modify the contents.
Advantages of using PHP
PHP works a little differently. Instead of downloading the entire page (with the navigation, content and everything in one file), php allows you to embed programming code that isn’t displayed to the end user. This programming code allows you to tell the page, “Insert the top navigation here.” Or, “put the content for the page over there.”
PHP allows you to personalize a page, for example, or automatically detect that a user is coming into the site from a mobile device and display a different version of the site that is optimized for their Blackberry or iPhone. PHP keeps most of the code for the site “behind the scenes” so that the page that is displayed to the end user loads quickly and doesn’t require the browser to do processing work — the work is handled instead by the server.
PHP Is Ideal For Working With Databases
One of the biggest advantages of a programming language like PHP is that it allows you to easily interact with a database. If you’re unfamiliar with databases, think of a database as a souped-up form of an Excel spreadsheet. You have columns (i.e. page name, content, title) and rows. Rows typically would hold information that is organized by column headings.
PHP makes it easy to read information from a database, and then display information onto a web page. So, if you’ve ever used a site where you type in your zip code to find a store location near you, the system likely is taking your zip code, performing a database query (i.e. find all stores within 10 miles of the 80303 zip code) and display the results so that you can find your way. In order to do this, we have a geolocation database that allows us to tell the approximate distance between two zip codes.
You could do the same thing by building out a series of web pages that has each location. And while this is fine for three or four locations, as the number of locations increases, PHP allows you to automate the process.
Source: sitepronews.com
Random Website Design Articles
Tags: .NET Components
This entry was posted on Thursday, December 3rd, 2009 at 9:55 am and is filed under Software Outsourcing, Web Development. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
















