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.

Question about accounting functions

Discussion in 'General Discussion' started by comcage, Jul 28, 2003.

  1. comcage

    comcage Member

    Joined:
    Jul 26, 2003
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    I was just wondering(just joined the forums and havent searched around much) if there was any talk of the Accounting Functions for Perl being brought to the PHP side of things(addpkg, editpkg). Reason being, my site is ran in mostly PHP, and while I can add and delete WHM accounts through my own scripts, I cannot add/edit packages because I don't want to redo my site in both PHP/CGI(there is a lot of information there so changing it around would be very bad).

    Also are there any plans to make a killpackage type function or anything like that?

    If anyone can answer those and possibly tell me if theres a way to execute a CGI file after a PHP form has been submitted(and get the values from the PHP form to the CGI file so I can do sort of cross-coding WHM package account adding) it would be much appreciated.

    Thank you.

    cPanel.net Support Ticket Number:
     
  2. amard

    amard Well-Known Member

    Joined:
    Jan 18, 2003
    Messages:
    100
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Herts, UK
    Hi,

    Cant you just do one of the following?:

    PHP:
    system(lynx "http://www.yourdomain.com/cgi-bin/script.cgi?variable1=value1&variable2=value2");
    Or

    PHP:
    system (perl /path/to/script.cgi --variable1=value1 --variable2=value2);

    HTH

    Rob

    cPanel.net Support Ticket Number:
     
  3. comcage

    comcage Member

    Joined:
    Jul 26, 2003
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    I never thought of doing either of those :), as you can see I'm still learning PHP as I go.

    I'll go try those out, thanks man.

    cPanel.net Support Ticket Number:
     
  4. comcage

    comcage Member

    Joined:
    Jul 26, 2003
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Whenever I do the one with lynx i get a parse error, am I just retarded, was lynx a typo or should I not've put lynx in there at all?

    Thanks.

    cPanel.net Support Ticket Number:
     
  5. amard

    amard Well-Known Member

    Joined:
    Jan 18, 2003
    Messages:
    100
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Herts, UK
    Hi,

    Log into Telnet/SSH and type:

    If it comes back with nothing, you don't have it.

    Another alternative is the "wget" command, although that will try to download the file aswell.

    You can also try the "include" function. eg:

    PHP:
    include ("cgi-bin/script.cgi");
    The list goes on, fsockopen etc.

    Best thing to do is to buy yourself a good book on PHP so that you can learn things quickly.


    HTH

    Rob

    cPanel.net Support Ticket Number:
     
  6. comcage

    comcage Member

    Joined:
    Jul 26, 2003
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    I typed whereis lynx and it came up with

    bash-2.05a$ whereis lynx
    lynx: /usr/bin/lynx /etc/lynx.cfg /usr/share/man/man1/lynx.1.gz

    So what do i need to do in that case(if you know). Sorry for all the q's just figured I'd come here to get some help.

    cPanel.net Support Ticket Number:
     
  7. amard

    amard Well-Known Member

    Joined:
    Jan 18, 2003
    Messages:
    100
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Herts, UK
    Hi,

    Try:

    PHP:
    <?PHP

    exec
    ("lynx http://www.yourdomain.com/cgi-bin/script.cgi?variable1=value1&variable2=value2"$output);

    print 
    $output;

    ?>

    HTH

    Rob

    cPanel.net Support Ticket Number:
     
  8. comcage

    comcage Member

    Joined:
    Jul 26, 2003
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    That came back with "Array" in the Print $output

    cPanel.net Support Ticket Number:
     
  9. comcage

    comcage Member

    Joined:
    Jul 26, 2003
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    I tried it with the lynx in the quotes like you showed in the exec except i did the system thing and it came back with some weird random letters and numbers like this

    /A0Gvy0 and then said Permission Denied any ideas?

    cPanel.net Support Ticket Number:
     
  10. amard

    amard Well-Known Member

    Joined:
    Jan 18, 2003
    Messages:
    100
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Herts, UK
    PHP probably doesn't have shell permissions, I think WHM mentions something about disabling suexec.


    Rob

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page