Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Aug 2008
    Posts
    3

    Question PHP scripts to complete basic CPanel tasks.

    Hi guys: Since this is the Olympian season once again, I thought I'd go for gold on the most stupid newbie question on these forums

    Bang: There's the gun and we're off!

    I feel there must have been written a simple bunch of PHP scripts to complete basic CPanel tasks like adding a new email account, forwarder or autoresponder. Something that could be called from the website's regular public_html folder by a normal [but well secured] PHP file - viz: setup_my_new_autoresponder.php

    After quite a bunch of searching miles I am without any real success. I've found references which are beyond my simple understanding [here] and old stuff that is now apparently not working on CPanel 11 [http://www.zubrag.com/scripts/ Clearly good stuff in its time but now apparently out of date].

    Before I try to reinvent what must surely be an already very well developed 'wheel' can somebody point me in the right direction, please?

    Many thanks - all contributions *very* gratefully received. PdeP.

    BTW: If that doesn't get the gold ... I shall be very surprised!

  2. #2
    Member
    Join Date
    May 2005
    Posts
    100

    Default

    Shytalk - try cPanel's new XMLAPI. An example of how it would be used to access cPanel see here. There is a class somewhere on the forums that will interface the XMLAPI with PHP.

    Alternately, try modifying the PHP cPanel Accounting API source code. With a tiny amount of modification you could make it call cPanel pages and get you the result.
    Last edited by djbob2; 08-12-2008 at 07:08 PM.

  3. #3
    Registered User
    Join Date
    Aug 2008
    Posts
    3

    Question Thanks for that - but how about these?

    Thanks for that djbob2. I rather think adaptation of those are beyond my abilities.

    However since my original post I have found the attached. They are dated 3rd December 2006 and I think, for this reason, they don't work with CPanel v11 which I have.

    Anbody any idea please how I can get these brought up to date or adapted?

    Or maybe it's because I'm not calling them properly. Maybe somebody with CPanel 11 might like to check them out and let me know, please. TIA
    Attached Files

  4. #4
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,718
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by shytalk264 View Post
    Thanks for that djbob2. I rather think adaptation of those are beyond my abilities.

    However since my original post I have found the attached. They are dated 3rd December 2006 and I think, for this reason, they don't work with CPanel v11 which I have.

    Anbody any idea please how I can get these brought up to date or adapted?

    Or maybe it's because I'm not calling them properly. Maybe somebody with CPanel 11 might like to check them out and let me know, please. TIA

    The fault with this script is that it does not use APIs (which, admittedly, were not available in 2006). Instead it relies on the old X theme of cPanel. New scripts should instead use our XML API so they are not affected by events such as interface enhancements.

    I know the APIs can be a bit daunting at first, but feel welcome to contact the sales team with any of your API questions. API1 and API2 via the XML-API can perform nearly any task that can be performed via the cPanel interface.

  5. #5
    Member
    Join Date
    May 2005
    Posts
    100

    Default

    I rather think adaptation of those are beyond my abilities.
    As I mentioned, somebody already wrote a PHP wrapper class around the XMLAPI. Search the forums and you should be able to find it. If you know PHP my guess is that you'll be OK working with the wrapper class

  6. #6
    Registered User
    Join Date
    Aug 2008
    Posts
    3

    Smile Eureka! - You dont-ta smell-la so good yerself, gringo!

    Okay - I've got it now! Simple really when you catch on - like a lot of other things, I guess. All responses much appreciated.

Similar Threads & Tags
Similar threads

  1. Replies: 3
    Last Post: 12-01-2010, 05:36 PM
  2. Replies: 1
    Last Post: 10-28-2010, 08:14 PM
  3. basic php question
    By Wicked in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 04-28-2008, 01:04 AM
  4. PHP scripts accessing Cpanel
    By rod985 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 05-09-2005, 03:16 PM
  5. PHP in cPanel scripts?
    By boolean in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 04-29-2003, 04:40 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube