📜 ⬆️ ⬇️

The history of one class for error handling.

Preface (You can safely skip)



Enjoy your day.

I had the desire to share with you one story. The history of the error handling class. Why not just bring the class “as is” and not let you judge its merits and demerits? The reason is simple. In this case, it will not be possible to understand why he became exactly as he is. It will not be possible to detect errors in the logic of its creation. It is impossible to understand whether the situation is similar to mine and whether it is possible for you to use it, or perhaps it is better to turn your attention to another class of error handling. Fortunately, those you will find many.
')
And why did I even start writing my own error handling class? After all, there are lots of developments in this area. Developments of serious, very intelligent people. The reason is simple. Various reasons led to the creation of these classes, the creation of these classes pursued different goals. And, as we all know well, bicycles are not enough and their taste is different.

At first, I had the need to write several classes that I could use in my projects and that would be simpler and faster than the analogs and, most importantly, would implement the functionality I needed. No more and no less. No redundancy.

First sketches



No sooner said than done. Classes have been written. And, quite naturally, they all had to work with errors. Here are the requirements I made for such processing:
So everything is relatively simple. What we add to the class to implement the work with errors:Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  1. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  2. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  3. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  4. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  5. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  6. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  7. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  8. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  9. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  10. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  11. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  12. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  13. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  14. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  15. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  16. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  17. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  18. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  19. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  20. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  21. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  22. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  23. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  24. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  25. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  26. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  27. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  28. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  29. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  30. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  31. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  32. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  33. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  34. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );
  35. Copy Source | Copy HTML class test_class{ private $err ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function some_method(){ $this ->clear_err(); if (some_err){ $this ->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->clear_err(); $this ->some_method(); if ( $this ->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->is_err()!== false ){ die ( $test_instance ->is_err()); } die ( 'No error appear.' );


Functionalization in a separate class



Here you go. Everything is working. There is only one unpleasant moment. This code is repeated in each class. While the class was alone, everything was fine. But as soon as the number of classes grew, it became at least inconvenient. So the code was allocated in a separate class.
Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  1. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  2. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  3. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  4. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  5. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  6. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  7. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  8. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  9. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  10. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  11. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  12. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  13. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  14. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  15. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  16. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  17. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  18. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  19. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  20. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  21. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  22. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  23. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  24. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  25. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  26. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  27. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  28. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  29. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  30. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  31. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  32. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  33. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  34. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  35. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  36. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  37. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  38. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  39. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  40. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );
  41. Copy Source | Copy HTML class error_class{ private $err = false ; public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } } class test_class{ public $err ; public function __construct(){ $this ->err = new error_class(); } public function some_method(){ $this ->err->clear_err(); if (some_err){ $this ->err->set_err( $msg = 'Some error appear.' ); return false ; } return true ; } public function complex_method(){ $this ->err->clear_err(); $this ->some_method(); if ( $this ->err->is_err()!== false ){ return false ; } return true ; } } define( 'some_err' , true ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ die ( $test_instance ->err->is_err()); } die ( 'No error appear.' );


Handling critical errors with exceptions.



Here you go. Already better. You can apply it with any class by adding it once at the beginning of the class file that uses it.
Copy Source | Copy HTML require_once ( "error_class.php" );
Copy Source | Copy HTML require_once ( "error_class.php" );
  1. Copy Source | Copy HTML require_once ( "error_class.php" );


Here, only the information about the presence of errors, he passes, and does not deal with their processing. It would be rather strange to create an additional class for intercepting and directing errors to the processor, so let's expand its functionality a little bit:


To handle critical errors, use exceptions .
set_exception_handler - defines a custom handler for exceptions.
restore_exception_handler - restores the previous handler for exceptions.
Exception - the base class for all exceptions.

Everything is elementary.


And our code acquires the following form:
Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; public function __construct( $callback =null){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); } } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } } }
Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; public function __construct( $callback =null){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); } } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } } }
  1. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; public function __construct( $callback =null){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); } } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } } }
  2. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; public function __construct( $callback =null){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); } } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } } }
  3. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; public function __construct( $callback =null){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); } } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } } }
  4. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; public function __construct( $callback =null){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); } } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } } }
  5. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; public function __construct( $callback =null){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); } } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } } }
  6. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; public function __construct( $callback =null){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); } } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } } }
  7. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; public function __construct( $callback =null){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); } } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } } }
  8. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; public function __construct( $callback =null){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); } } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } } }
  9. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; public function __construct( $callback =null){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); } } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } } }
  10. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; public function __construct( $callback =null){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); } } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } } }
  11. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; public function __construct( $callback =null){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); } } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } } }
  12. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; public function __construct( $callback =null){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); } } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } } }
  13. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; public function __construct( $callback =null){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); } } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } } }
  14. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; public function __construct( $callback =null){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); } } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } } }
  15. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; public function __construct( $callback =null){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); } } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } } }
  16. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; public function __construct( $callback =null){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); } } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } } }
  17. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; public function __construct( $callback =null){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); } } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } } }
  18. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; public function __construct( $callback =null){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); } } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } } }
  19. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; public function __construct( $callback =null){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); } } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } } }
  20. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; public function __construct( $callback =null){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); } } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } } }
  21. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; public function __construct( $callback =null){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); } } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } } }
  22. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; public function __construct( $callback =null){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); } } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } } }
  23. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; public function __construct( $callback =null){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); } } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } } }
  24. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; public function __construct( $callback =null){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); } } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } } }
  25. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; public function __construct( $callback =null){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); } } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } } }
  26. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; public function __construct( $callback =null){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); } } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } } }
  27. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; public function __construct( $callback =null){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); } } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } } }
  28. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; public function __construct( $callback =null){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); } } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } } }

Using the class will now look like this:
Copy Source | Copy HTML define( 'some_err' , true ); $err = new error_class( "err_overwork" ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ $err ->fire_err( $test_instance ->err->is_err(),- 1 ); } function err_overwork( $error ){ die ( ": " . $error ->getMessage(). "<br/>: " . $error ->getFile(). "<br/>: " . $error ->getLine()); }
Copy Source | Copy HTML define( 'some_err' , true ); $err = new error_class( "err_overwork" ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ $err ->fire_err( $test_instance ->err->is_err(),- 1 ); } function err_overwork( $error ){ die ( ": " . $error ->getMessage(). "<br/>: " . $error ->getFile(). "<br/>: " . $error ->getLine()); }
  1. Copy Source | Copy HTML define( 'some_err' , true ); $err = new error_class( "err_overwork" ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ $err ->fire_err( $test_instance ->err->is_err(),- 1 ); } function err_overwork( $error ){ die ( ": " . $error ->getMessage(). "<br/>: " . $error ->getFile(). "<br/>: " . $error ->getLine()); }
  2. Copy Source | Copy HTML define( 'some_err' , true ); $err = new error_class( "err_overwork" ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ $err ->fire_err( $test_instance ->err->is_err(),- 1 ); } function err_overwork( $error ){ die ( ": " . $error ->getMessage(). "<br/>: " . $error ->getFile(). "<br/>: " . $error ->getLine()); }
  3. Copy Source | Copy HTML define( 'some_err' , true ); $err = new error_class( "err_overwork" ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ $err ->fire_err( $test_instance ->err->is_err(),- 1 ); } function err_overwork( $error ){ die ( ": " . $error ->getMessage(). "<br/>: " . $error ->getFile(). "<br/>: " . $error ->getLine()); }
  4. Copy Source | Copy HTML define( 'some_err' , true ); $err = new error_class( "err_overwork" ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ $err ->fire_err( $test_instance ->err->is_err(),- 1 ); } function err_overwork( $error ){ die ( ": " . $error ->getMessage(). "<br/>: " . $error ->getFile(). "<br/>: " . $error ->getLine()); }
  5. Copy Source | Copy HTML define( 'some_err' , true ); $err = new error_class( "err_overwork" ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ $err ->fire_err( $test_instance ->err->is_err(),- 1 ); } function err_overwork( $error ){ die ( ": " . $error ->getMessage(). "<br/>: " . $error ->getFile(). "<br/>: " . $error ->getLine()); }
  6. Copy Source | Copy HTML define( 'some_err' , true ); $err = new error_class( "err_overwork" ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ $err ->fire_err( $test_instance ->err->is_err(),- 1 ); } function err_overwork( $error ){ die ( ": " . $error ->getMessage(). "<br/>: " . $error ->getFile(). "<br/>: " . $error ->getLine()); }
  7. Copy Source | Copy HTML define( 'some_err' , true ); $err = new error_class( "err_overwork" ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ $err ->fire_err( $test_instance ->err->is_err(),- 1 ); } function err_overwork( $error ){ die ( ": " . $error ->getMessage(). "<br/>: " . $error ->getFile(). "<br/>: " . $error ->getLine()); }
  8. Copy Source | Copy HTML define( 'some_err' , true ); $err = new error_class( "err_overwork" ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ $err ->fire_err( $test_instance ->err->is_err(),- 1 ); } function err_overwork( $error ){ die ( ": " . $error ->getMessage(). "<br/>: " . $error ->getFile(). "<br/>: " . $error ->getLine()); }
  9. Copy Source | Copy HTML define( 'some_err' , true ); $err = new error_class( "err_overwork" ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ $err ->fire_err( $test_instance ->err->is_err(),- 1 ); } function err_overwork( $error ){ die ( ": " . $error ->getMessage(). "<br/>: " . $error ->getFile(). "<br/>: " . $error ->getLine()); }
  10. Copy Source | Copy HTML define( 'some_err' , true ); $err = new error_class( "err_overwork" ); $test_instance = new test_class; $test_instance ->complex_method(); if ( $test_instance ->err->is_err()!== false ){ $err ->fire_err( $test_instance ->err->is_err(),- 1 ); } function err_overwork( $error ){ die ( ": " . $error ->getMessage(). "<br/>: " . $error ->getFile(). "<br/>: " . $error ->getLine()); }


Error handling generated by the interpreter.



Here you go. Now it remains to add only one. The ability (the ability to) pass the user error handling function and errors generated by the interpreter (excluding, of course, syntax errors). Thus, it will be possible to achieve uniformity of the display of errors. Of course, the need for this is extremely controversial. To use or not - you decide. It seems to me that this may sometimes be appropriate.

set_error_handler - allows you to pass error handling to a custom handler.
restore_error_handler - restores the previous error handler.
ErrorException - Exception class for error presentation.

In principle, nothing complicated. Using set_error_handler, install the handler and you 're done. As additional arguments in the constructor, we take:

But there is a nuance. In the case of an error generated by us, the handler receives an Exception object. But if the error was generated by the interpreter, it receives a set of arguments. Naturally, it is appropriate to make it so that regardless of the source, the handler receives homogeneous data. An ErrorException object was designed specifically for this. So, we add the function redirect_err to the error handling class, which will handle the error, namely, to raise an exception, which will already be intercepted by a handler assigned by the user. In addition, we add a flag that will indicate that errors generated by the interpreter are intercepted and need to restore the previous handler, if necessary, using the restore_error_handler function in the class constructor .
And now our class takes the finished and ready to use view:
Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  1. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  2. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  3. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  4. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  5. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  6. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  7. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  8. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  9. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  10. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  11. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  12. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  13. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  14. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  15. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  16. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  17. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  18. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  19. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  20. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  21. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  22. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  23. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  24. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  25. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  26. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  27. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  28. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  29. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  30. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  31. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  32. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  33. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  34. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  35. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  36. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  37. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  38. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  39. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }
  40. Copy Source | Copy HTML class error_class{ private $err = false ; private $exception_handler = false ; private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback !=null){ $this ->exception_handler= true ; set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0, $errno , $errfile , $errline ); return true ; } public function set_err( $msg = '' ){ $this ->err= $msg ; } public function clear_err(){ $this ->err= false ; } public function is_err(){ return $this ->err; } public function fire_err( $msg = '' , $code =0){ $this ->err= $msg ; throw new Exception ( $msg , $code ); } public function __destruct(){ if ( $this ->exception_handler){ restore_exception_handler(); } if ( $this ->err_redirect){ restore_error_handler(); } } }

And here is a real-life example of code using it:
Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  1. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  2. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  3. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  4. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  5. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  6. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  7. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  8. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  9. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  10. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  11. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  12. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  13. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  14. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  15. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  16. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  17. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  18. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  19. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  20. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  21. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  22. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  23. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  24. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  25. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  26. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  27. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  28. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  29. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  30. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  31. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  32. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  33. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  34. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  35. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  36. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  37. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  38. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  39. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  40. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  41. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  42. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  43. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  44. Copy Source | Copy HTML <?php session_start(); require_once ( "error_class.php" ); require_once ( "mail_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ $err ->fire_err( " " ,- 1 ); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ $err ->fire_err( " " ,- 1 ); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); if (! $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ])))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->to( " « »" , "raven@nightfolk.net" )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->from(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->subj( ' ' )){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->reply_to(addslashes( $_POST [ 'email' ]))){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } if (! $mailer ->send()){ $err ->fire_err( $mailer ->err->is_err(),- 1 ); } header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>

Enlightenment (IMPORTANT)


After a stormy and productive communication with a lot of very angry people,
Reading the article " Handling Exceptional Situations in OOP "
Three-time rereading of the documentation on the mechanism of exceptions in php
And, finally, discuss the problems on the forum phpclub.ru .
I realized that exceptions are quite a sufficient mechanism for implementing error handling and it does not make sense to drag in something else.
However, in order not to duplicate the destination code of the default exception handler and the error message handler generated by the interpreter, at each entry point, the existence of a class in the following form makes sense:
Copy Source | Copy HTML class error_class{ private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback ==null){ throw new Exception ( " callback ." ,E_ERROR); } set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0 , $errno , $errfile , $errline ); return true ; } public function __destruct(){ restore_exception_handler(); if ( $this ->err_handler){ restore_error_handler(); } } }
Copy Source | Copy HTML class error_class{ private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback ==null){ throw new Exception ( " callback ." ,E_ERROR); } set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0 , $errno , $errfile , $errline ); return true ; } public function __destruct(){ restore_exception_handler(); if ( $this ->err_handler){ restore_error_handler(); } } }
  1. Copy Source | Copy HTML class error_class{ private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback ==null){ throw new Exception ( " callback ." ,E_ERROR); } set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0 , $errno , $errfile , $errline ); return true ; } public function __destruct(){ restore_exception_handler(); if ( $this ->err_handler){ restore_error_handler(); } } }
  2. Copy Source | Copy HTML class error_class{ private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback ==null){ throw new Exception ( " callback ." ,E_ERROR); } set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0 , $errno , $errfile , $errline ); return true ; } public function __destruct(){ restore_exception_handler(); if ( $this ->err_handler){ restore_error_handler(); } } }
  3. Copy Source | Copy HTML class error_class{ private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback ==null){ throw new Exception ( " callback ." ,E_ERROR); } set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0 , $errno , $errfile , $errline ); return true ; } public function __destruct(){ restore_exception_handler(); if ( $this ->err_handler){ restore_error_handler(); } } }
  4. Copy Source | Copy HTML class error_class{ private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback ==null){ throw new Exception ( " callback ." ,E_ERROR); } set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0 , $errno , $errfile , $errline ); return true ; } public function __destruct(){ restore_exception_handler(); if ( $this ->err_handler){ restore_error_handler(); } } }
  5. Copy Source | Copy HTML class error_class{ private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback ==null){ throw new Exception ( " callback ." ,E_ERROR); } set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0 , $errno , $errfile , $errline ); return true ; } public function __destruct(){ restore_exception_handler(); if ( $this ->err_handler){ restore_error_handler(); } } }
  6. Copy Source | Copy HTML class error_class{ private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback ==null){ throw new Exception ( " callback ." ,E_ERROR); } set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0 , $errno , $errfile , $errline ); return true ; } public function __destruct(){ restore_exception_handler(); if ( $this ->err_handler){ restore_error_handler(); } } }
  7. Copy Source | Copy HTML class error_class{ private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback ==null){ throw new Exception ( " callback ." ,E_ERROR); } set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0 , $errno , $errfile , $errline ); return true ; } public function __destruct(){ restore_exception_handler(); if ( $this ->err_handler){ restore_error_handler(); } } }
  8. Copy Source | Copy HTML class error_class{ private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback ==null){ throw new Exception ( " callback ." ,E_ERROR); } set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0 , $errno , $errfile , $errline ); return true ; } public function __destruct(){ restore_exception_handler(); if ( $this ->err_handler){ restore_error_handler(); } } }
  9. Copy Source | Copy HTML class error_class{ private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback ==null){ throw new Exception ( " callback ." ,E_ERROR); } set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0 , $errno , $errfile , $errline ); return true ; } public function __destruct(){ restore_exception_handler(); if ( $this ->err_handler){ restore_error_handler(); } } }
  10. Copy Source | Copy HTML class error_class{ private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback ==null){ throw new Exception ( " callback ." ,E_ERROR); } set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0 , $errno , $errfile , $errline ); return true ; } public function __destruct(){ restore_exception_handler(); if ( $this ->err_handler){ restore_error_handler(); } } }
  11. Copy Source | Copy HTML class error_class{ private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback ==null){ throw new Exception ( " callback ." ,E_ERROR); } set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0 , $errno , $errfile , $errline ); return true ; } public function __destruct(){ restore_exception_handler(); if ( $this ->err_handler){ restore_error_handler(); } } }
  12. Copy Source | Copy HTML class error_class{ private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback ==null){ throw new Exception ( " callback ." ,E_ERROR); } set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0 , $errno , $errfile , $errline ); return true ; } public function __destruct(){ restore_exception_handler(); if ( $this ->err_handler){ restore_error_handler(); } } }
  13. Copy Source | Copy HTML class error_class{ private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback ==null){ throw new Exception ( " callback ." ,E_ERROR); } set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0 , $errno , $errfile , $errline ); return true ; } public function __destruct(){ restore_exception_handler(); if ( $this ->err_handler){ restore_error_handler(); } } }
  14. Copy Source | Copy HTML class error_class{ private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback ==null){ throw new Exception ( " callback ." ,E_ERROR); } set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0 , $errno , $errfile , $errline ); return true ; } public function __destruct(){ restore_exception_handler(); if ( $this ->err_handler){ restore_error_handler(); } } }
  15. Copy Source | Copy HTML class error_class{ private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback ==null){ throw new Exception ( " callback ." ,E_ERROR); } set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0 , $errno , $errfile , $errline ); return true ; } public function __destruct(){ restore_exception_handler(); if ( $this ->err_handler){ restore_error_handler(); } } }
  16. Copy Source | Copy HTML class error_class{ private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback ==null){ throw new Exception ( " callback ." ,E_ERROR); } set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0 , $errno , $errfile , $errline ); return true ; } public function __destruct(){ restore_exception_handler(); if ( $this ->err_handler){ restore_error_handler(); } } }
  17. Copy Source | Copy HTML class error_class{ private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback ==null){ throw new Exception ( " callback ." ,E_ERROR); } set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0 , $errno , $errfile , $errline ); return true ; } public function __destruct(){ restore_exception_handler(); if ( $this ->err_handler){ restore_error_handler(); } } }
  18. Copy Source | Copy HTML class error_class{ private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback ==null){ throw new Exception ( " callback ." ,E_ERROR); } set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0 , $errno , $errfile , $errline ); return true ; } public function __destruct(){ restore_exception_handler(); if ( $this ->err_handler){ restore_error_handler(); } } }
  19. Copy Source | Copy HTML class error_class{ private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback ==null){ throw new Exception ( " callback ." ,E_ERROR); } set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0 , $errno , $errfile , $errline ); return true ; } public function __destruct(){ restore_exception_handler(); if ( $this ->err_handler){ restore_error_handler(); } } }
  20. Copy Source | Copy HTML class error_class{ private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback ==null){ throw new Exception ( " callback ." ,E_ERROR); } set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0 , $errno , $errfile , $errline ); return true ; } public function __destruct(){ restore_exception_handler(); if ( $this ->err_handler){ restore_error_handler(); } } }
  21. Copy Source | Copy HTML class error_class{ private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback ==null){ throw new Exception ( " callback ." ,E_ERROR); } set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0 , $errno , $errfile , $errline ); return true ; } public function __destruct(){ restore_exception_handler(); if ( $this ->err_handler){ restore_error_handler(); } } }
  22. Copy Source | Copy HTML class error_class{ private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback ==null){ throw new Exception ( " callback ." ,E_ERROR); } set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0 , $errno , $errfile , $errline ); return true ; } public function __destruct(){ restore_exception_handler(); if ( $this ->err_handler){ restore_error_handler(); } } }
  23. Copy Source | Copy HTML class error_class{ private $err_handler = false ; public function __construct( $callback =null, $err_redirect = true , $level =E_ALL){ if ( $callback ==null){ throw new Exception ( " callback ." ,E_ERROR); } set_exception_handler( $callback ); if ( $err_redirect ){ $this ->err_handler = true ; set_error_handler( array ( "error_class" , "redirect_err" ), $level ); } } public function redirect_err( $errno , $errstr , $errfile , $errline , $errcontext ){ throw new ErrorException ( $errstr , 0 , $errno , $errfile , $errline ); return true ; } public function __destruct(){ restore_exception_handler(); if ( $this ->err_handler){ restore_error_handler(); } } }
Now you can assign a handler in one line: Copy Source | Copy HTML new error_class( 'err_overwork' ); function err_overwork( $error ){ }
Copy Source | Copy HTML new error_class( 'err_overwork' ); function err_overwork( $error ){ }
  1. Copy Source | Copy HTML new error_class( 'err_overwork' ); function err_overwork( $error ){ }
  2. Copy Source | Copy HTML new error_class( 'err_overwork' ); function err_overwork( $error ){ }
  3. Copy Source | Copy HTML new error_class( 'err_overwork' ); function err_overwork( $error ){ }


Well, the script will look like this:

Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  1. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  2. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  3. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  4. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  5. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  6. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  7. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  8. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  9. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  10. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  11. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  12. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  13. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  14. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  15. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  16. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  17. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  18. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  19. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  20. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  21. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  22. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  23. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  24. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  25. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  26. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  27. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  28. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  29. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  30. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  31. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  32. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>
  33. Copy Source | Copy HTML <?php session_start(); header( "content-type: text/html; charset=utf-8" ); require_once ( "mail_class.php" ); require_once ( "error_class.php" ); $err = new error_class( "err_overwork" ); if ( ! isset ( $_POST [ 'email' ])|| ! isset ( $_POST [ 'message' ])|| ! isset ( $_POST [ 'captcha' ]) ){ throw new Exception ( " " ,E_ERROR); } if ( $_SESSION [ 'captcha' ]!= $_POST [ 'captcha' ]){ throw new Exception ( " " ,E_ERROR); } else { unset ( $_SESSION [ 'captcha' ]); } $mailer = new mail_class(); $mailer ->text(addslashes(htmlspecialchars( $_POST [ 'message' ]))); $mailer ->to( " « »" , "raven@nightfolk.net" ); $mailer ->from(addslashes( $_POST [ 'email' ])); $mailer ->subj( ' ' ); $mailer ->reply_to(addslashes( $_POST [ 'email' ])); $mailer ->send(); header( "location:../confirm.html" ); die (); function err_overwork( $error ){ $_SESSION [ 'error_message' ]= $error ->getMessage(); header( "location:../error.php" ); die (); } ?>


Afterword (In principle - nothing particularly important)



I hope that this article will be interesting to you or even bring some benefit.
I would be very happy.
I would be very grateful to you if you would write your thoughts on the class and its development process.
If you see something that can be improved - write.
If you see any flaws, vulnerabilities or errors - write .
And if you write, then in this world, perhaps, at least not for a long time will be one happy me more.
And also - write, whether you liked the article or it turned out to be protracted and tedious. I want to know - should I write more ... Or will it be just an agony of a graphomaniac.
PS I can describe another class caching or templating. You never know what. The main thing that it would be interesting to you.

Thanks (Read required)



Thank you sunnybear for the invitation to Habrahabr, for the wonderful YASS framework and for being gluey. I liked it on RIT.
Thank you habraname for showing interest in YASS, writing a funny wrapper and just being nice to talk to.
Thanks to zerkms for taking the time to clarify and push for additional experiments.

Source: https://habr.com/ru/post/56416/


All Articles