With error_reporting(E_ALL); removed, my script works fine, however when I uncomment it, the following notice appears:
Notice: Undefined variable: messages in /home/www/test/register/html/form_1.html.php on line 11
On line 11, there is a function, which basically iterates over an array argument:
function displayMessages($array)
{
if (!empty($array) && isset($array))
{
foreach ($array as $number => $error)
{
echo '<font size="3" color="#990000">' . "* $error" . "</font></br>";
}
}
elseif (empty($array) || !isset($array) )
{
echo "";
}
elseif (empty($array) || !isset($array))
{
$array = array();
$array = null;
}
}
I've added the if condition to check if its empty, because sometimes I will pass an empty array.
This is a small part of these three files, it's supposed to be a registration form: index.php output.php and form_1.html.php All found here ( http://pastie.org/1062886 )
The index file checks if the user has filled in out the values and validates them, however if they haven't it'll place an error in the respective error array, the display error function is supposed to display them if there are values in the array passed to it.
I bet the solution is pretty basic, but I am a noob and its making me pull my hair out.