10 Cool Things to Do With PHP

Fun and Useful Things PHP Can Do on Your Website

PHP is a server-side programming language that is used in conjunction with HTML to enhance the features of a website. So what can you do with PHP? Here are 10 fun and useful things you can use PHP for on your website. 

1
Send Email From a Form

Man using laptop in kitchen
Compassionate Eye Foundation/Digital Vision/Getty Images

You can use PHP to send email from a form on your website. Giving users this method of contacting you cuts down on spam you receive from directly placing an email 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 email.

2
Have a Member Log In

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 log in to your site. All of the users' information is stored in a MySQL Database with encrypted passwords.

3
Count Visitors

How often are people checking out your website? 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.

4
Rotate Banner Ads

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 a rotating page header or rotating random quotes.

5
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 standalone script or incorporated into other scripts where dates are important.

6
Last Visited

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.

7
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.

8
Host a Web Forum

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

9
Add a Poll

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.

10
Template Your Site

If you like to redesign the look of your site often, or just want to 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 your PHP files access the same design. This means when you make a change, you only need to update one file and all your pages change.