Okay, the code is long and boring but I am at a loss.
Basically I have a form, and the form gets put into an array of objects. The object name is Person().
However if they have not filled out the form correctly, it will display an error, such as "Email cannot be left blank".
The problem is that if there are errors in the form, the page dies at a very specific place.
At this point, the object looks like this:
Array
(
[0] => Person Object
(
[firstname:Person:private] => Richard
[lastname:Person:private] => Gert
[gender:Person:private] =>
[age:Person:private] =>
[add1:Person:private] =>
[add2:Person:private] =>
[add3:Person:private] =>
[add4:Person:private] =>
[postcode:Person:private] =>
[country:Person:private] =>
[phone:Person:private] => 3299394
[email:Person:private] => right@left.com
[price:Person:private] => 67.5
[additional:Person:private] =>
[active:Person:private] => 1
[ref:Person:private] => c75af
[ticketref:Person:private] => 0acbc
[org:Person:private] => RA
[type:Person:private] => wc
)
)
And that's fine. The page is dying though at this bit:
<tr><td class="top left" width="200px">First Name</td>
<td class="top right">
<input type="text" class="txt" name="firstname" value="<?=$people[0]->firstname();?>">
</td></tr>
And the function for firstname is:
function firstname() {if($this->firstname) return($this->firstname);}
Same as every other function really in the person class.
But why is it failing here even when there is a firstname to output? It gives no errors, in fact the HTML at this point looks like this:
<tr><td class="top left" width="200px">First Name</td><td class="top right">
The page halts or dies even before it writes the words <input...
.
I cannot figure out why.
*Error reporting is most definitely turned on. Also - If the form is filled out correctly (email, telephone number etc) the code runs absolutely fine. The object is filled and the user is moved on to stage 2. *