cyberspace
Technical User
I'm fairly new to PHP so please excuse me!
I have written a script for my employers website that takes information from a form and then emails it to an account handler.
There was plenty of code on teh internet for this so i was able to pick it up pretty quickly.
I would like to incorporate some basic error handling. I am able to get it to work by simply using if statements....ie
if (empty($name) || empty($email) || empty($etc)) {
header( "Location: $errorurl" );
exit ;
This forwards to a generic page that says simply "there are fields empty, please use the back button and fill in all fields"
I would like to expand this so that there is a list of missing fields on the error page, but i'm not too sure how to go about it?
Any links or tips would be most appreciated!
Thanks.
'When all else fails.......read the manual'
I have written a script for my employers website that takes information from a form and then emails it to an account handler.
There was plenty of code on teh internet for this so i was able to pick it up pretty quickly.
I would like to incorporate some basic error handling. I am able to get it to work by simply using if statements....ie
if (empty($name) || empty($email) || empty($etc)) {
header( "Location: $errorurl" );
exit ;
This forwards to a generic page that says simply "there are fields empty, please use the back button and fill in all fields"
I would like to expand this so that there is a list of missing fields on the error page, but i'm not too sure how to go about it?
Any links or tips would be most appreciated!
Thanks.
'When all else fails.......read the manual'