Jump to content

Need help with validation


gaza165

Recommended Posts

<?
  function __construct($host, $user, $pass, $type = 'imap', $mbox = 'INBOX', $port = null) {
    $this->host = $host;
    $this->user = $user;
    $this->pass = $pass;
    $this->type = strtolower($type);
    if (is_null($port)) {
      switch($this->type) {
        case 'imap' :
          $this->port = 143;
          break;
        case 'pop3' :
          $this->port = 110;
          break;
        case 'nntp' :
          $this->port = 119;
          break;
      }
    }
    else {
      $this->port = $port;
    }
    $this->mbox = $mbox;
    $mailbox = "$this->host:$this->port/$this->type";
$this->mh = imap_open("{" . $mailbox . "}$this->mbox", $this->user, $this->pass, 16);
  }

?>

 

what i want is an error check to see if the imap_open connected properly and display the relevant messages.

 

help??

Link to comment
https://forums.phpfreaks.com/topic/161496-need-help-with-validation/
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.