Class :: cPanel Subdomain V2

Class :: cPanel Subdomain V2

This is the 2nd edition of my previous Class cPanel Subdomains Creator. Using this script you can create cPanel subdomain & FTP account for this subdomain without logging into cPanel. Let your user create their own subdomains and FTP accounts for that subdomain. Users will get access only to newly created subdomain not to the root directory. So your contents will be secure.

To use this script you must have access to cPanel.

Open exaple.php file and change the red marked values as your environment.


$cpanel=new cpsubdomain("cPanel User","cPanel Pass","Domain","cPanel Theme");

For example:

$cpanel=new cpsubdomain("mysite","12345","mysite.com","x");

Now change the Quota for each FTP account. To do this simply change the red marked value.

echo $cpanel->createFTP($_POST['subdomain'],$_POST['ftppass'],"20");

Download

  • very good

    very good

  • Usman Malik

    🙂 Hello nice script, but I
    🙂 Hello nice script, but I got into this error:

    Subdomain created successfully
    There may be some error while creating FTP account.

    What can be the reason?

  • please check whether the
    please check whether the username for FTP is already used. bcoz it will try to create ftp on the same name of subdomain. also check your ftp accounts quota.

    thanks

  • Techtac

    Hello
    The original script
    Hello
    The original script has a way to add subdomains from file. Is there a way to do this from this script??
    thanks
    techtac

  • Purvi

    Very Nice
    Thanks

    Very Nice

    Thanks

  • Tejas

    Hello,
    I just go through
    Hello,

    I just go through this script but is there any other script to create Domain or Parked Domain without entering in cPanel?

    If is there then guide me to reach this functionality.

    Thanks & Waiting for your reply,

    TEJAS

  • Dear Tejas,
    Not a bad idea.
    Dear Tejas,
    Not a bad idea. If you want, I may make such script for you. Mail to if you are interested.

    Thanks

  • (Not a bad idea. If you want, I may make such script for you. Mail to if you are interested.
    )

    I would like a script like this how much are you charging?

  • admin

    please contact me over mail. (the hungrycoder @ gmail . com). Omit all spaces.

    thanks

  • Mir

    Does this script check if the subdomain already exists?

  • Mir

    Disregard my last comment, I was wondering how to create a subdomain account in WHM instead of cPanel, would you just change the port and user/pass?

  • admin

    @Mir,
    Why should we do it when WHM provides api for that? Creating a subdomain (in fact creating a new cpanel account), is easy using WHM’s api.

  • Mir

    Yes i was taking a look at it (http://twiki.cpanel.net/twiki/bin/view/AllDocumentation/AutomationIntegration/CreateAccount), but im not sure if i can get it to work, but i will try it. Thanks for your help.

  • Mir

    I dont think i can get it to work because i dont want to create the subdomain, instead i just check if it exists or not.

    I could create the subdomain, and if it is a success, then just delete it, but that would waste a lot of server resources(using a vps)

    Do you have any suggestions?