The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Subdomain creation

Discussion in 'General Discussion' started by webtec, Jun 8, 2002.

  1. webtec

    webtec Member

    Joined:
    Apr 18, 2002
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Does anyone know how I can automate subdomain creation using Cpanel scripts? Is it even possible?

    I would like to setup a form to collect user and payment information for the subscriber so they can create a subdomain upon payment. I tried doing the same as what is being done in cpanel subdomain's index.html page but I'm having permission problems.

    Is there a way I can set it up so my users can create their own subdomains upon c.c. acceptance?

    This is what I'm using to try to create the subdomain:
    &cpanel SubDomain=&addsubdomain($FORM{'domain'})&&
    Is this correct?

    Thank you,
    wthCJ ;)
     
  2. nsolent

    nsolent Registered

    Joined:
    Sep 5, 2002
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    yes

    I'm also interested in the same type of thing.
    Althought I'm guessing I could wing it with CURL... theres got to be a better way though.
     
  3. webtec

    webtec Member

    Joined:
    Apr 18, 2002
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    with PHP

    I'm want to do this through PHP. What are you using to attempt this? PHP? Perl?
     
  4. nsolent

    nsolent Registered

    Joined:
    Sep 5, 2002
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    PHP is my flavor of choice.
    maybe this will give you some ideas:


    //I wrote this PHP to retrieve Bandwidth info from my cPanel4 page and email me (and others)
    //each subdomain's bandwidth and the total bandwidth for the current month
    //All this because there isn't a public stats page in cpanel
    //also note that cpanel doesn't update this subdomain stats page very often

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL,&http://yourusername:yourpassword@yourdomain.com:2082/frontend/power/stats/bandwidth.html&);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
    $result=curl_exec ($ch);
    curl_close ($ch);

    //$result has the whole stats page; I find what i need in it and email it to myself.
    //subdomain creation would be about the same.. except you'd be submitting the subdomain name to the form that's in cpanel
    //I can send you a whole example of this email thing if you want...
    //perhaps later i'll post the subdomain creation if i ever do it, but right now i'm checking out this nixt.org script for reselling full accounts from whm
     
Loading...

Share This Page