The followings websites have good and useful PHP scripts that may be useful in web design.

PHP Login Script

This tutorial shows how to :

  • create a simple login system using PHP code on our pages, and
  • a MySQL database to store our users information.

The PHP Login Script will also track the users who are logged in with cookies.

http://php.about.com/od/finishedphp1/ss/php_login_code.htm

PHP Captcha Form Validation

This tutorial shows how to use an image verification, called as captcha, to protect form submissions. It will dynamically create an image with a random string displayed on it. Then visitor is asked to type that string in a text field and once the form is submitted it checks if the string on the image matches the one inputted by the user.

http://technotz.info/tutorials/2012/11/Captcha/

Designing a Captcha System with PHP and MySQL

This tutorial shows how to use captcha to protect form submissions. There are basically two ways to generate captcha using PHP. One uses PHP alone; the other can be done using a MySQL database.

http://www.devshed.com/c/a/php/designing-a-captcha-system-with-php-and-mysql/

PHP Contact form with image verification

Another tutorial shows how to use Captcha Image Validation to protect contact form from spamming.

http://www.thewebhelp.com/php/scripts/php-contact-form-with-image-validation/

PHP Units Conversion Script

This PHP Script converts degrees Celsius and Fahrenheit; centimeters and inches; meters and feet; kilometers and miles; kilograms and pounds; milliliters to ounces; and for fun, regular beers and tall beers.

http://www.phpbuilder.com/snippet/detail.php?type=snippet&id=226

How to display execution progress of a PHP script?

For long scripts that might take more than 10 seconds to finish, this is better to show a kind of progress status while the PHP script is running. Otherwise the users do not know what’s going on and may be go away from your site. Please check the following discussion for more details:

http://board.phpbuilder.com/showthread.php?10206216-How-to-display-execution-progress-of-a-PHP-script

How To Write A Function In PHP

For starters, what is a function? A function is a collection of code that is available for use and reuse repeatedly throughout a particular script or application. You’re probably already familiar with functions because you probably use them in PHP. If you’ve used print() or mysql_connect() you’ve used a function.

The beauty of functions is that you don’t have to rewrite the same code over and over again. Once it’s encapsulated in a function, that function provides a shortcut to executing the code you’ve defined.

This is a good tutorial for beginner.

http://www.brandonsavage.net/how-to-write-a-function-in-php/

PHP mysql_connect() Function

Warning: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQL extension should be used. Check out the PHP online documentation for more details:

http://php.net/manual/en/function.mysql-connect.php

Using PHP to Backup MySQL Databases

There are at least three ways to backup your MySQL Database :

  • Execute a database backup query from PHP file.
  • Run mysqldump using system() function.
  • Use phpMyAdmin to do the backup.

This tutorial shows how to use PHP to Backup MySQL Databases. This website also has some of interesting PHP tutorials:

http://www.php-mysql-tutorial.com/wikis/mysql-tutorials/using-php-to-backup-mysql-databases.aspx