faqts : Computers : Programming : Languages : PHP : Common Problems

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

2 of 3 people (67%) answered Yes
Recently 2 of 3 people (67%) answered Yes

Entry

How can i call an error script page from another script which is being executed on a server?

May 7th, 2004 13:53
Narendra Jain, Pablo Mazorra,


Use include and call to the function within your scrpt as below:
If original script is a.php and error_handler is a function in b.php,
the structure would look like:
a.php
-----
include ("b.php");
if (!$variable1) {
   call error_handler($error_number);
} else {
   echo "Processing now... <br> \n";
}
b.php
-----
function error_handler($err_no) {
   echo "Error#: $err_no <br> \n";
   return
}