1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

10 Cool Things To Do With PHP

Fun and useful things PHP can do on your website

By

So what can I do with PHP? Here are ten of our favorite fun (and useful) things you can use PHP for on your website. Looking for more PHP ideas? Check out our step-by-step section with lots of tutorials on other things you can do with PHP.

Send E-mail From a Form

Man using laptop in kitchen
Compassionate Eye Foundation/Digital Vision/Getty Images
You can use PHP to send e-mail from a form on your website. Giving users this method of contacting you can help cut down on spam you might receive from directly placing an e-mail link on your site. It also lets you choose the fields you want a user to fill in, so you know you are getting all the information you need in the e-mail.

Have a Member Login

You can use PHP to create a special area of your website for members. You can allow users to register, and then use the registration information to login to your site. All of the users information is stored in a MySQL Database, with encrypted passwords.

Count Visitors

How often are people checking you out? You can use PHP to create a page hit counter. For a simple counter you don't even need to have a database, you can do it with just PHP using flat files.

Rotate Banners

If you host banner advertisements on your website, you can use PHP to rotate them randomly. You can also apply this same principal to add things like a rotating page header, or rotating random quotes.

Create a Calendar

You can use PHP to find today's date, and then build a calendar for the month. You can also generate a calendar around a specified date. A calendar can be used as a stand alone script, or incorporated into other scripts where dates are important.

Last Visited

You can tell users the last time they visited your website. PHP can do this by storing a cookie in the user's browser. When they come back, you can read the cookie and remind them that the last time they visited was two weeks ago!

Redirect Users

Whether you want to redirect users from an old page on your site that no longer exists to a new page on your site, or you simply want to give them a shorter URL to remember, PHP can be used to redirect users. All of the redirection information is done server side, so it is smoother than redirecting with HTML.

Host a Web Forum

PHP is one of the most popular languages to create a web forum in. You can use a forum that already exists and modify it for your needs, or you can write a new one from scratch. PHP will usually store forum information in a MySQL database. This allows large quantities of information to be stored, and accessed quickly as needed.

Add a Poll

You can use PHP to let your visitors take part in a poll. You can also use the GD Library with PHP to display the results of your poll visually instead of just listing the results in text.

Template Your Site

If you like to redesign the look of your site often, or just keep the content fresh on all the pages, then this is for you. By keeping all of the design code for your site in separate files, you can have all of your PHP files access the same design. This means that if you make a change, you only need to update one file and all of your pages will change.
Top Related Searches
  • mail link
  • e mail
  • spam
    1. About.com
    2. Technology
    3. PHP / MySQL
    4. Step By Steps
    5. Ten Cool Things To Do With PHP for Your Website

    ©2014 About.com. All rights reserved.