I created this into a cgi file

#!/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

Recommended Answers

All 5 Replies

I don't think you can have CGI in an HTML file?

you can use <iframe> tag provided by html

or use php

<?php
$data = shell_exec(uptime); 
echo $data;
?>
commented: Nice answer. +36

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)

commented: Frames suck - you have it 100% right. +36
Member Avatar for TKSS

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.

What http server are you using? I would recommend a SSI (server-side include) if possible.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.