Jump to content

help with class


steviez

Recommended Posts

Not sure if you need an entire class for just errors. Usually the errors are in an existing class. For instance if you have a class for mysql functions, then you would put the error checking right in the class.

 

but to answer your question

 

error.class.php

<?php
class error_check{

  function showError($msg){
  $message = $msg;
  return $message;
  }
}
?>

 

then include file on page

<?php
include ('error.class.php');
$error = new error_check();

echo $error->showError("my error here");
?>

 

Ray

 

 

Link to comment
https://forums.phpfreaks.com/topic/112626-help-with-class/#findComment-578418
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.