943,343 Members | Top Members by Rank

Ad:
  • Perl Discussion Thread
  • Unsolved
  • Views: 6983
  • Perl RSS
Dec 10th, 2003
0

Uptime

Expand Post »
I created this into a cgi file

Quote ...
#!/usr/bin/perl
#
# sload - current server load
#

print "Content-type: text/html\n\n";

print <<EOM;
<META HTTP-EQUIV="Refresh" CONTENT=15>
<TITLE> $ENV{SERVER_NAME} HTTPD Load </TITLE>

<H2> Current load average of
<A HREF=/>$ENV{SERVER_NAME}</A><HR></H2>
EOM

print `uptime`;
print "<P>";
Now I want that on my website.. how do I create the html to show it on my index.htm instead of having another window poping up showing the uptime.cgi
Last edited by root; Dec 10th, 2003 at 4:10 am.
Reputation Points: 13
Solved Threads: 0
Junior Poster
root is offline Offline
106 posts
since May 2003
Dec 23rd, 2003
0

Re: Uptime

I don't think you can have CGI in an HTML file?
Team Colleague
Reputation Points: 53
Solved Threads: 5
PHP/vBulletin Guru
Gary King is offline Offline
360 posts
since Nov 2003
Dec 24th, 2003
0

Re: Uptime

you can use <iframe> tag provided by html

or use php
[php]<?php
$data = shell_exec(uptime);
echo $data;
?>[/php]
Reputation Points: 46
Solved Threads: 1
Junior Poster in Training
jayant is offline Offline
95 posts
since Nov 2003
Dec 24th, 2003
1

Re: Uptime

Yep, but remember that it must be a PHP file then if you want to use PHP (unless you use frames again, which I highly dislike personally :p)
Team Colleague
Reputation Points: 53
Solved Threads: 5
PHP/vBulletin Guru
Gary King is offline Offline
360 posts
since Nov 2003
Mar 25th, 2004
0

Re: Uptime

You should be able to cross over into a small flash button or half banner and embed that code...I think...not sure on that.
TKS
Reputation Points: 108
Solved Threads: 18
Posting Pro in Training
TKS is offline Offline
470 posts
since Jan 2004
Mar 25th, 2004
0

Re: Uptime

What http server are you using? I would recommend a SSI (server-side include) if possible.
Reputation Points: 87
Solved Threads: 12
Posting Whiz in Training
i686-linux is offline Offline
208 posts
since Mar 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Perl Forum Timeline: Open HTML Page
Next Thread in Perl Forum Timeline: Questions you'd like to ask Larry Wall the creator of Perl





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC