Thread: exec();

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Posts
    6
    Rep Power
    0
    hello guys.. i need some help about exec();
    well i know that exec("ndc reload"); would perform that command.. but i want too print out on the page what the command tells
    when i do like this:
    [root@xermin cryzeck]# ndc reload
    Reload initiated.
    [root@xermin cryzeck]#

    i want to print that Reload initiated. on the page.. how?
    not just echo("reload initiated"); but the stuff the command tells.

    Thanks!
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    France
    Posts
    16
    Rep Power
    0
    You can use any of the execution function to achieve this.

    you can use passthru($command,$rc) . It executes a command and print raw output to screen. $rc is an optional argument which contains the return status.

    Or the backticks operator :
    $output=`$command`;
    echo "<pre>$output</pre>";


    hth

    JBL

Similar Threads

  1. PHP locking up with EXEC???
    By Webbywarehouse in forum PHP Development
    Replies: 2
    Last Post: May 17th, 2005, 09:49 PM
  2. Problems with exec()
    By gsoper in forum PHP Development
    Replies: 0
    Last Post: February 13th, 2004, 03:34 AM
  3. "set prompt" using exec or system
    By bln in forum Perl Programming
    Replies: 1
    Last Post: September 15th, 2003, 01:30 PM
  4. exec() on win2k again!
    By binky in forum PHP Development
    Replies: 2
    Last Post: April 22nd, 2002, 07:45 AM
  5. Replies: 0
    Last Post: May 16th, 2001, 03:18 PM

IMN logo majestic logo threadwatch logo seochat tools logo