Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Aug 2009
    Posts
    9

    Default List accounts with php

    Hello,

    I have been looking to find out how to list accounts with php outside of cpanel

    and i am having a bit of a issue
    PHP Code:
    $site "http://{$whmuser}:{$whmpass}@localhost:2086/scripts2/listaccts?viewall=1&nohtml=1";
    $result file_get_contents($site);
    $breakresult explode(","$result);

    foreach (
    $breakresult as $key){ // Split the cPanel Function array into bits. 
    echo $key;

    that dont seem right to me. how can i list accounts in a table out side of cpanel/whm?

  2. #2
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,189
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by DavidS View Post
    Hello,

    I have been looking to find out how to list accounts with php outside of cpanel

    and i am having a bit of a issue
    PHP Code:
    $site "http://{$whmuser}:{$whmpass}@localhost:2086/scripts2/listaccts?viewall=1&nohtml=1";
    $result file_get_contents($site);
    $breakresult explode(","$result);

    foreach (
    $breakresult as $key){ // Split the cPanel Function array into bits. 
    echo $key;

    that dont seem right to me. how can i list accounts in a table out side of cpanel/whm?
    I would use the listaccts function in the XML API. We have documentation for that function at:

    ListAccounts < AllDocumentation/AutomationIntegration < TWiki

    However, if you are coding in PHP 5, we have a PHP 5 class you can use at:

    http://forums.cpanel.net/f42/xmlapi-...ss-111897.html

  3. #3
    Member
    Join Date
    Aug 2009
    Posts
    9

    Default

    i tryed that, and i am having a issue with puting that data into a table, and i am having another isue creating links, like make the domains in a link, and the emails, etc.

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

    Root Administrator

    Default

    Quote Originally Posted by DavidS View Post
    i tryed that, and i am having a issue with puting that data into a table, and i am having another isue creating links, like make the domains in a link, and the emails, etc.
    If you are unfamiliar with programming in HTML and PHP, I recommend seeking tutorials on those topics. Searches on internet search engines helped me when I was learning about these topics.

  5. #5
    Member
    Join Date
    Aug 2009
    Posts
    9

    Default

    Quote Originally Posted by cPanelDavidG View Post
    If you are unfamiliar with programming in HTML and PHP, I recommend seeking tutorials on those topics. Searches on internet search engines helped me when I was learning about these topics.
    i know about html and php, just not working with xml and inserting it into a table

  6. #6
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,189
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by DavidS View Post
    i know about html and php, just not working with xml and inserting it into a table
    You can find information about using XML in PHP by visiting: PHP: SimpleXML - Manual

    To echo data into a table, be sure to echo/print the information in PHP within the relevant <table>/<td> HTML tags.

Similar Threads & Tags
Similar threads

  1. list php open_basedir accounts
    By tuxer in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 08-22-2010, 08:50 PM
  2. Unable to create or remove accounts / New accounts not in list accounts
    By yoseman in forum cPanel and WHM Discussions
    Replies: 26
    Last Post: 10-18-2007, 12:18 PM
  3. List email accounts with PHP
    By snakex in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 02-08-2007, 09:25 PM
  4. How to kill an account that isn\'t in the list accounts list
    By Domenico in forum cPanel and WHM Discussions
    Replies: 9
    Last Post: 09-29-2001, 11:07 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube