Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

API2_query output problem

Discussion in 'cPanel Developers' started by ankitpsaraogi, Sep 18, 2014.

  1. ankitpsaraogi

    ankitpsaraogi Registered

    Joined:
    Sep 18, 2014
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Hi,
    I used the following code
    PHP:
    include '../xmlapi.php';

    $ip 'ip';
    $root_pass 'pwd';

    $account "acc";

    $xmlapi = new xmlapi($ip);
    $xmlapi->password_auth($account,$root_pass);
    $xmlapi->set_output("json");
    $xmlapi->set_port(2082);
    $xmlapi->set_debug(1);
    $output $xmlapi->api2_query($account"Email""listpopswithdisk" );
    print 
    $output;
    The output was in
    such a format
    {"cpanelresult":{"apiversion":2,"preevent":{"result":1},"data":[{"mtime":1411037171,"diskquota":"unlimited","_diskused":"54

    I want the output to be in a table. Can anyone suggest
    how can I do so
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,794
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello :)

    I have moved this thread to our developers forum. You should receive more user-feedback here.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. tdl

    tdl Member

    Joined:
    Jun 18, 2013
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Can you clarify, do you want to store this data in a MySQL table or do you want to output as an HTML table?
     
  4. sf.basilix

    sf.basilix Registered

    Joined:
    Feb 16, 2015
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    I'm trying to learn this and am curious how to do this also - would you be able to provide an example for each (as a MySQL table and as HTML)?

    Thanks in advance!
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice