![]() | ![]() | ![]() |
| |||||||
| Forums | Register | Groups | Awards | Arcade | Pets | T-Bucks / T-Store | Invite Your Friends | Blogs | Mark Forums Read |
| Web Design Forums and discussions on webdesign |
Web Design | |||||||||
|
|
|
|
| |||||
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| Civilians | Okay boys and girls, here's a little PHP script wot I wrote that outputs the "top" command to your web browser screen. For those who don't know, it's used on *nix systems and shows a snapshot of running processes, memory usage, CPU load etc. <?php print "<pre>"; system("top -n1 b"); print "</pre>"; ?> "n1" is the number of iterations that the "top" command should run. "b" is "batch" which allows the output to be written. -- Charles Sweeney http://CharlesSweeney.com |
|
| | #2 (permalink) |
| Civilians | Charles Sweeney wrote: > Els wrote > >> Richard wrote: >> >>>> <?php >>>> print "<pre>"; >>>> system("top -n1 b"); >>>> print "</pre>"; >>>> ?> >>> >>> I've tried it, but it only output "<pre></pre>" ? >> >> That's the outcome on my Windows box. >> On Unix, I get this: >> Warning: system() has been disabled for security reasons in >> /home/..... > > Naturally, if a command is disabled it won't work! I know :-) Was just mentioning it, so Richard can see it does work on a Unix system, even if it doesn't.. Hmm.. weird sentence <g> -- Els http://locusmeus.com/ Sonhos vem. Sonhos vão. O resto é imperfeito. - Renato Russo - |
|
| | #3 (permalink) |
| Civilians | Els wrote > Was just mentioning it, so Richard can see it does work on a Unix > system, even if it doesn't.. > > Hmm.. weird sentence <g> It's ok, I understand! -- Charles Sweeney http://CharlesSweeney.com |
|
| | #4 (permalink) |
| Civilians | if system is disabled in php, then use shell script instead as a cgi-script: #!/bin/bash echo "content-type: text/html <PRE>`top -n1 b`</PRE>";exit 0 (it's also the same number of lines of code - including blanks). hth Greg -- http://www.nod32usa.com |
|
| | #6 (permalink) |
| Civilians | newsposting0209@webyourbusiness.com wrote: > if system is disabled in php, then use shell script instead as a > cgi-script: > > #!/bin/bash > echo "content-type: text/html > > <PRE>`top -n1 b`</PRE>";exit 0 > > (it's also the same number of lines of code - including blanks). > > hth Well, I think using shell is also blocked on the server I tried system() on :-) -- Els http://locusmeus.com/ Sonhos vem. Sonhos vão. O resto é imperfeito. - Renato Russo - |
|
| | #7 (permalink) |
| Civilians | Els wrote > newsposting0209@webyourbusiness.com wrote: > >> if system is disabled in php, then use shell script instead as a >> cgi-script: >> >> #!/bin/bash >> echo "content-type: text/html >> >> <PRE>`top -n1 b`</PRE>";exit 0 >> >> (it's also the same number of lines of code - including blanks). >> >> hth > > Well, I think using shell is also blocked on the server I tried > system() on :-) You need to get yourself a proper server! I think Greg was referring to the script running in shell, not your access. Try it and find out. -- Charles Sweeney http://CharlesSweeney.com |
|
![]() |
| Bookmarks |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| SQL Server Login Error while connecting from MPP to Project Server.Please help | Sreejith | Microsoft Applications | 2 | 12-30-2006 07:34 |
| Re: Email Status Requests in Project 2003 (w/o posting to the server) | Mike Glen | Microsoft Applications | 1 | 07-16-2005 12:00 |
| Possible to install Project 2003 Server on W2K3 Server DC?? | screwie | Microsoft Applications | 1 | 11-18-2004 15:35 |
| Battlezone Server Status | xiongnu | Gaming club | 10 | 07-19-2004 19:03 |
| SQL Server / Analysis Server as source for powerpoint charts | Richm | Microsoft Applications | 2 | 06-16-2004 12:17 |
![]() | ![]() | ![]() |