Hi Everyone,
I routinely use the DIE function for terminating my code if, say, someone does not properly fill out a form. The challenge is, the sites I design are often very intensive HTML layouts and I need to include the remainder of the HTML code in each instance.
For example:
if (empty($student_first_name))
{
die("<p align='center'><font face='Arial' size='3' color='#FF0000'>You did not enter your first name.<br>Please </font><a href='javascript:history.go(-1)'><font face='Arial' size='3' color='#FF0000'><b><u>click here</u></b></font></a><font face='Arial' size='3' color='#FF0000'> to go back and correct this entry.</font></p></td><td bgcolor=#d3d6da></td></tr><tr><td><img src=p4.gif /></td><td bgcolor=#d3d6da></td><td><img src=p3.gif /></td></tr></table>");
}
As you can see, I either need to have all the remaining HTML for that page in each DIE function, or use an include to point to the remaining HTML.
My question is there an alternate, more efficient way?
In the old days I could us a 'goto' command to point the end of that page or layout and 'goto' that in the event of a error or missing or incomplete entry.
I appreciate your suggestions,
Don