6 Useful Things To Do With PHP

PHP Code

Scott-Cartwright / Getty Images

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. 

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.

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.

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.

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

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.

Template Your Site

If you like to redesign the look of your site often or 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.

mla apa chicago
Your Citation
Bradley, Angela. "6 Useful Things To Do With PHP." ThoughtCo, Feb. 16, 2021, thoughtco.com/cool-things-to-do-with-php-2693857. Bradley, Angela. (2021, February 16). 6 Useful Things To Do With PHP. Retrieved from https://www.thoughtco.com/cool-things-to-do-with-php-2693857 Bradley, Angela. "6 Useful Things To Do With PHP." ThoughtCo. https://www.thoughtco.com/cool-things-to-do-with-php-2693857 (accessed June 7, 2023).