First code, the one that generates the code and checks it. Save as "numverify.php".
---
#################
# numverify.php #
#################
if (!$num_ent)
{
$nums = array("5","6","7","8","d","e","1","2","3","4","f","g","h","i","j","k","9","0","a","b","c","l","m","n","o","p","q","x","y","z","A","B","C","D","r","s","t","u","v","w","E","F","G","N","O","P","Q","R","S","H","I","J","K","L","M","T","W","X","Y","Z","U","V");
// Creates 10 random array access keys to nums.
$random_key = array_rand($nums, 10);
$random = "";
for ($i=0;$i<10;$i++)
{
// Uses random access keys to access 10 random elements in the array.
$random = $random . $nums[$random_key[$i]];
}
echo "";
echo "