cPanel Resources

Discussion in 'PHP' started by danpadams, Feb 25, 2005.

  1. #1
    Does anyone know of a source of information on how to automate some of the tasks that can be done from within a cPanel interface but from PHP. I know I have the ability to do this partly due to the idea of a GPG code to do this from PHP, but I am unsure of how to go about this, can someone post a link to point me in the right direction?

    Thanks in advance,
    Dan
     
    danpadams, Feb 25, 2005 IP
  2. Juls

    Juls Well-Known Member

    Messages:
    1,867
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    170
    #2
    if it is some simple features/functions like add email or what not... you can do a post through the https with your login info and send all the required variables...

    alternatively you can go to cpanel's website to read up on their api but i think that it mainly works with whm accounts... like the script autowhm to resell hosting..

    good luck.. sorry i dont have any place to point you to... i once used the post method to offer free pop3 accounts and just recorded the info into mysql so that i could automate admin functions like deleting accounts but moderating individual emails is not possible this way.

    thanks,

    juls
     
    Juls, Feb 25, 2005 IP
  3. danpadams

    danpadams Peon

    Messages:
    101
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Well yes, email modifications, primarily adding the accounts is one thing I am desiring to do. But one of the other parts that I would like to do is to either add an add-on domain or a parked domain/subdomain combo, can the domain items be done through the post function. Is Curl best in PHP or is there a different way that is better in PHP?

    Dan
     
    danpadams, Feb 25, 2005 IP
  4. Juls

    Juls Well-Known Member

    Messages:
    1,867
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    170
    #4
    ya you can do the add-on domain or parked domain / subdomain combo.... you can pretty much use any of the features through post.... and yes curl is the best but not necessary...

    that is my opinion.. :)
     
    Juls, Feb 25, 2005 IP
  5. danpadams

    danpadams Peon

    Messages:
    101
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    If Curl is best, but not necessary, how would a person go about doing this idea, either using curl or otherwise? I do want to stay in PHP with it though, that way it can be automated from my database and other things can be connected to it.

    Dan
     
    danpadams, Feb 25, 2005 IP
  6. Juls

    Juls Well-Known Member

    Messages:
    1,867
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    170
    #6
    you can use fsockopen but only if your server doesnt have curl setup and you dont have enough access to set it up yourself.. :)


    there is another sketchier way but use either of those two methods... but i prefer curl... actually both are just as simple.

    good luck
     
    Juls, Feb 25, 2005 IP
  7. danpadams

    danpadams Peon

    Messages:
    101
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Is there a tutorial or maybe a help page on this topic? I am definately interested. Also would this method let me interface with some of the other features within the cPanel system? I can gather the URLs and such that the tools I am desiring to use are, but one of the main parts that I am not sure about is the login stuff and how I would make sure that would work.

    Dan
     
    danpadams, Feb 25, 2005 IP
  8. Juls

    Juls Well-Known Member

    Messages:
    1,867
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    170
    #8
    Dan,

    I will look for a tutorial for you but to my knowledge one doesnt exist. This is something that I just messed and tried after I saw a php cpanel email script for sale. Basically like authorization through .htaccess just provide the username:password at the beginning of the url. like

    https://juls:seomasterintraining@www.digitalpoint.com:2082/cpanelfeature.html

    hope that helps.. ;-)
    Thanks,

    Juls
     
    Juls, Feb 25, 2005 IP
  9. danpadams

    danpadams Peon

    Messages:
    101
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Yeah, as far as the username/password is concerned that is what I figured it would be, with curl in php, do you know how one would go about preparing a POST packet?
     
    danpadams, Feb 26, 2005 IP
  10. mxlabs

    mxlabs Peon

    Messages:
    327
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #10
    mxlabs, Feb 26, 2005 IP
  11. sadcox66

    sadcox66 Spirit Walker

    Messages:
    496
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #11
    sadcox66, Mar 2, 2005 IP