Re: [PHP] ps command in php

2003-10-06 Thread David Otton
On Mon, 6 Oct 2003 14:55:56 +0800, you wrote:

I'm trying to have the output of the ps -ef command in Linux to my
browser. Can anyone help how to properly have the output in proper format.
I've used the passthru() function but the output is scrambled.

Scrambled how, exactly? Remember, your browser is expecting HTML.

Personally, I'd try adding a Content-Type: text/plain header before the
output...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] ps command in php

2003-10-06 Thread Mike Migurski
I'm trying to have the output of the ps -ef command in Linux to my
browser. Can anyone help how to properly have the output in proper
format. I've used the passthru() function but the output is scrambled.

What do you mean by 'scrambled'? The following works for me:
echo 'pre', `ps -ef`, '/pre';

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] ps command in php

2003-10-06 Thread Michael P. Carel
I'm doing like this:
 $ps = (passthru(ps -ef));

echo $ps;

my output is something like this:
UID PID PPID C STIME TTY TIME CMD root 1 0 0 Sep19 ? 00:00:04 init [3] root
2 1 0 Sep19 ? 00:00:00 [kflushd] root 3 1 0 Sep19 ? 00:00:09 [kupdate] root
4 1 0 Sep19 ? 00:00:00 [kpiod] root 5 1 0 Sep19 ? 00:00:04 [kswapd] root 6 1
0 Sep19 ? 00:00:00 [mdrecoveryd] bin 404 1 0 Sep19 ? 00:00:00 [portmap] root
429 1 0 Sep19 ? 00:03:33 syslogd -m 0 root 438 1 0 Sep19 ? 00:00:01 klogd
nobody 452 1 0 Sep19 ? 00:00:00 identd -e -o nobody 454 452 0 Sep19 ?
00:00:00 identd -e -o nobody 457 454 0 Sep19 ? 00:00:00 identd -e -o nobody
458 454 0 Sep19 ? 00:00:00 identd -e -o nobody 459 454 0 Sep19 ? 00:00:00
identd -e -o daemon 470 1 0 Sep19 ? 00:00:00 /usr/sbin/atd root 484 1 0
Sep19 ? 00:00:01 crond root 502 1 0 Sep19 ? 00:00:00 inetd root 539 1 0

What  i want is to format it just like what  it seen in the console:

UIDPID  PPID  C STIME TTY  TIME CMD
root 1 0  0 Sep19 ?00:00:04 init [3]
root 2 1  0 Sep19 ?00:00:00 [kflushd]
root 3 1  0 Sep19 ?00:00:09 [kupdate]
root 4 1  0 Sep19 ?00:00:00 [kpiod]
root 5 1  0 Sep19 ?00:00:04 [kswapd]

any idea?




 I'm trying to have the output of the ps -ef command in Linux to my
 browser. Can anyone help how to properly have the output in proper
 format. I've used the passthru() function but the output is scrambled.

 What do you mean by 'scrambled'? The following works for me:
 echo 'pre', `ps -ef`, '/pre';

 -
 michal migurski- contact info and pgp key:
 sf/cahttp://mike.teczno.com/contact.html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] ps command in php

2003-10-06 Thread Mike Migurski
my output is something like this:
UID PID PPID C STIME TTY TIME CMD root 1 0 0 Sep19 ? 00:00:04 init [3] root
2 1 0 Sep19 ? 00:00:00 [kflushd] root 3 1 0 Sep19 ? 00:00:09 [kupdate] root
snip

any idea?

Yeah, see David Otton's response, or look at the HTML source of your
output.

-
michal migurski- contact info and pgp key:
sf/cahttp://mike.teczno.com/contact.html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] ps command in php

2003-10-06 Thread Nitin
your question has already been answered:

use:

echo pre $ps /pre;
It should definitely help

Nitin

- Original Message - 
From: Michael P. Carel [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, October 06, 2003 12:51 PM
Subject: Re: [PHP] ps command in php


 I'm doing like this:
  $ps = (passthru(ps -ef));

 echo $ps;

 my output is something like this:
 UID PID PPID C STIME TTY TIME CMD root 1 0 0 Sep19 ? 00:00:04 init [3]
root
 2 1 0 Sep19 ? 00:00:00 [kflushd] root 3 1 0 Sep19 ? 00:00:09 [kupdate]
root
 4 1 0 Sep19 ? 00:00:00 [kpiod] root 5 1 0 Sep19 ? 00:00:04 [kswapd] root 6
1
 0 Sep19 ? 00:00:00 [mdrecoveryd] bin 404 1 0 Sep19 ? 00:00:00 [portmap]
root
 429 1 0 Sep19 ? 00:03:33 syslogd -m 0 root 438 1 0 Sep19 ? 00:00:01 klogd
 nobody 452 1 0 Sep19 ? 00:00:00 identd -e -o nobody 454 452 0 Sep19 ?
 00:00:00 identd -e -o nobody 457 454 0 Sep19 ? 00:00:00 identd -e -o
nobody
 458 454 0 Sep19 ? 00:00:00 identd -e -o nobody 459 454 0 Sep19 ? 00:00:00
 identd -e -o daemon 470 1 0 Sep19 ? 00:00:00 /usr/sbin/atd root 484 1 0
 Sep19 ? 00:00:01 crond root 502 1 0 Sep19 ? 00:00:00 inetd root 539 1 0

 What  i want is to format it just like what  it seen in the console:

 UIDPID  PPID  C STIME TTY  TIME CMD
 root 1 0  0 Sep19 ?00:00:04 init [3]
 root 2 1  0 Sep19 ?00:00:00 [kflushd]
 root 3 1  0 Sep19 ?00:00:09 [kupdate]
 root 4 1  0 Sep19 ?00:00:00 [kpiod]
 root 5 1  0 Sep19 ?00:00:04 [kswapd]

 any idea?




  I'm trying to have the output of the ps -ef command in Linux to my
  browser. Can anyone help how to properly have the output in proper
  format. I've used the passthru() function but the output is scrambled.
 
  What do you mean by 'scrambled'? The following works for me:
  echo 'pre', `ps -ef`, '/pre';
 
  -
  michal migurski- contact info and pgp key:
  sf/cahttp://mike.teczno.com/contact.html

 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] ps command in php

2003-10-06 Thread Michael P. Carel
When I do this:
?header(Content-Type: text/plain);
$ps = (passthru(ps -ef)); ?
table width=100% border=0 cellpadding=0 cellspacing=0
  tr
td width=100% height=287 valign=top? echo $ps;  ?/td
  /tr
/table

I can also see the HTML code, i need to put  the output  inside the table.
Is there any solution for this?




 your question has already been answered:

 use:

 echo pre $ps /pre;
 It should definitely help

 Nitin

 - Original Message - 
 From: Michael P. Carel [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, October 06, 2003 12:51 PM
 Subject: Re: [PHP] ps command in php


  I'm doing like this:
   $ps = (passthru(ps -ef));
 
  echo $ps;
 
  my output is something like this:
  UID PID PPID C STIME TTY TIME CMD root 1 0 0 Sep19 ? 00:00:04 init [3]
 root
  2 1 0 Sep19 ? 00:00:00 [kflushd] root 3 1 0 Sep19 ? 00:00:09 [kupdate]
 root
  4 1 0 Sep19 ? 00:00:00 [kpiod] root 5 1 0 Sep19 ? 00:00:04 [kswapd] root
6
 1
  0 Sep19 ? 00:00:00 [mdrecoveryd] bin 404 1 0 Sep19 ? 00:00:00 [portmap]
 root
  429 1 0 Sep19 ? 00:03:33 syslogd -m 0 root 438 1 0 Sep19 ? 00:00:01
klogd
  nobody 452 1 0 Sep19 ? 00:00:00 identd -e -o nobody 454 452 0 Sep19 ?
  00:00:00 identd -e -o nobody 457 454 0 Sep19 ? 00:00:00 identd -e -o
 nobody
  458 454 0 Sep19 ? 00:00:00 identd -e -o nobody 459 454 0 Sep19 ?
00:00:00
  identd -e -o daemon 470 1 0 Sep19 ? 00:00:00 /usr/sbin/atd root 484 1 0
  Sep19 ? 00:00:01 crond root 502 1 0 Sep19 ? 00:00:00 inetd root 539 1 0
 
  What  i want is to format it just like what  it seen in the console:
 
  UIDPID  PPID  C STIME TTY  TIME CMD
  root 1 0  0 Sep19 ?00:00:04 init [3]
  root 2 1  0 Sep19 ?00:00:00 [kflushd]
  root 3 1  0 Sep19 ?00:00:09 [kupdate]
  root 4 1  0 Sep19 ?00:00:00 [kpiod]
  root 5 1  0 Sep19 ?00:00:04 [kswapd]
 
  any idea?
 
 
 
 
   I'm trying to have the output of the ps -ef command in Linux to my
   browser. Can anyone help how to properly have the output in proper
   format. I've used the passthru() function but the output is
scrambled.
  
   What do you mean by 'scrambled'? The following works for me:
   echo 'pre', `ps -ef`, '/pre';
  
   -
   michal migurski- contact info and pgp key:
   sf/cahttp://mike.teczno.com/contact.html
 
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] ps command in php

2003-10-06 Thread Pavel Jartsev
Michael P. Carel wrote:
When I do this:
?header(Content-Type: text/plain);
$ps = (passthru(ps -ef)); ?
table width=100% border=0 cellpadding=0 cellspacing=0
  tr
td width=100% height=287 valign=top? echo $ps;  ?/td
  /tr
/table
I can also see the HTML code, i need to put  the output  inside the table.
Is there any solution for this?
Just remove first line of Your code or replace 'text/plain' with 
'text/html'.

And put ? echo $ps; ? inside PRE-tags, as anwsered previously.

--
Pavel a.k.a. Papi
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] ps command in php

2003-10-06 Thread Michael P. Carel
thanks to all its working now

 Michael P. Carel wrote:
  When I do this:
  ?header(Content-Type: text/plain);
  $ps = (passthru(ps -ef)); ?
  table width=100% border=0 cellpadding=0 cellspacing=0
tr
  td width=100% height=287 valign=top? echo $ps;  ?/td
/tr
  /table
 
  I can also see the HTML code, i need to put  the output  inside the
table.
  Is there any solution for this?
 

 Just remove first line of Your code or replace 'text/plain' with
 'text/html'.

 And put ? echo $ps; ? inside PRE-tags, as anwsered previously.


 -- 
 Pavel a.k.a. Papi

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php