Question:
Do you want the ID to always contain four numbers.
For example, which is more correct:
xyz0001
xyz1
Because at the moment, you will get the later.
I saw this:
echo 'Your Pilot ID# is XYZ'.$PilotID.''; //CHANGE
Woud it not be better to change it to.
echo 'Your Pilot ID# is XYZ'.$PilotID; //CHANGE
The ending '' provided no output, and so were pointless.
Also, why not check the setting of magic_quotes_gpc before actually add slashes to the $_POST variables, otherwise they may get slashed twice. Maybe something like this:
<?php
// No support for multi-dimensional arrays (because probably not needed, easy to add if it is)
// Pass variable by reference.
function slashit(&$variable)
{
if(!magic_quotes_gpc())
{
if(is_array($variable))
{
while(list($key,$value) = each($variable))
{
$variable[$key]=addslashes($value);
}
@reset($variable);
}
else
{
$variable=addslashes($variable);
}
}
}
// Example
slashit($_POST);
?>
Also, $PilotID is an uninitialized variable - I think that is a mistake (and a security concern).
The format of the ID is only for show, there is no effect to the database. Is this what you want?