code & tutorials / php classes / class message home contact sitemap search print view add to favourites recommend site guestbook deutsch/german  

« i don't feel right unless i have a sport to play or at least a way to work up a sweat. »
(hank aaron)

 

 

class message

this class "message" can be used for message/error handling in php scripts. it provides message collection (1 to N) with different message types. There is also a method "write()" that handles the output to the client (with different icons/colors for different message types. take a look at the example.

  1. <?php
  2.  
  3. include_once '../class.message.php';
  4.  
  5. $msg = new message();
  6. $msg->add("I","Info")
  7. $msg->add("E","Error");
  8. $msg->add("W","Warn");
  9. $msg->add("S","Success");
  10. $msg->add("D","Stop");
  11. $msg->write("")
  12.  
  13. ?>
   
 
     
  © by marco voegeli, switzerland       357093 visitors total / © & disclaimer up