PHP Classes

File: examples.php

Recommend this page to a friend!
  Classes of Dan   cPanel X   examples.php   Download  
File: examples.php
Role: Example script
Content type: text/plain
Description: examples for cpanel class
Class: cPanel X
Manage cPanel hosting accounts
Author: By
Last change: refreshed
Date: 17 years ago
Size: 969 bytes
 

Contents

Class file image Download
<?
//You can use this class only with a cPanel hosting account


include "cpanel.php";

$cpanel = new cpanel();

//login with your hosting account
$cpanel->login('user','password','mydomain.com');

//if you don't want to see the cPanel output commment the next line
$cpanel->api_output();

//Exemples:
//don't run this script as is , comment all examples but one

//Ex 1:
//create new email address : newuser@mydomain.com with password: newpassword and a quota of 10Mb
$cpanel->create_email_account('newuser','newpassword','10');

//Ex 2:
//delete email account
$cpanel->delete_email_account('newuser');

//Ex 3:
//add subdomain one.mydomain.com
$cpanel->add_subdomain('one');

//Ex 4:
//add subdomain two.one.mydomain.com
$cpanel->add_subdomain('two','one.');

//Ex 5:
//delete subdomain two.one.mydomain.com
$cpanel->delete_subdomain('two.one')

//Ex 6:
//delete subdomain one.mydomain.com
$cpanel->delete_subdomain('one')
?>