Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of David Barnes  >  cPanel Tools  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example Usage
Class: cPanel Tools
Manage cPanel hosting accounts
Author: By
Last change: Typo
Date: 2006-11-18 18:21
Size: 871 bytes
 

Contents

Class file image Download
<?php
//  Here is a quick example of how to use the class, read the top of the class file for
//  the complete list of functions.  Some functions do not return errors (due to cpanel not returning errors)
//  Bear in mind that some functions may take awhile for cpanel to execute (like add addon domain), so it may
//  not be the best idea to wait for a response.

    
include('cPanelTools.php');
    
$cpanel = new cPanelTools('username','password','example.com');
    
// create email address
    
$errors $cpanel->emailCreate('dave@example.com','mypass');
    if(empty(
$errors)){
        echo 
'Email Address was Created!';
    }else{
        echo 
'There was an error<br>';
        
print_r($errors);
    }
    
    
// delete email (without bothering to collect the errors)
    
$cpanel->emailCreate('dave@example.com');
    
    
// Create subdomain
    
$cpanel->domainCreatedSub('testing','example.com');
?>