Iframe refresh questions...

M

Max

It's actually three questions.

1) I'd have a page that monitors some sites and polls ever 5 minutes. I'd
like to for example a line like:

Website A: UP

I'd like the UP to be an iframe without a border so that it appears as
though it's all the same page. The iframe has some PHP code that pings the
site, and then prints UP or Down. That part I already have setup, and if you
look at this page alone, it shows the UP or DOWN up in the top/left corner.
However when viewing it in the parent page, there is space on top/bottom, so
there is an up/down scroll bar that appears. I know you can eliminate the
scroll bar, but then you can't see the writing at all. How can I remove all
spaces? I've tried playing with margins, padding with no luck so far.

2) I think there is a way to use javascript to refresh each iframe that
might be on the page. Is this the way to go, or should each child (iframe
page) do it's own refreshing every 5 minutes?

3) Is there anyway to prevent the browser from showing the refresh activity?

I know some might say this might be better done with Ajax, and I'm looking
into that as well.

Thanks,
Max
 
T

Toby Inkster

Max said:
Website A: UP

I'd like the UP to be an iframe without a border so that it appears as
though it's all the same page. The iframe has some PHP code that pings the
site, and then prints UP or Down.

Seems a bit OTT. Why do you need an iframe at all? What's wrong with
putting this in the main page itself:

<?php
$host = 'websitea.example.org';
$ping = `ping -c1 -q '$host'`;

print "<strong>Website A:</strong> ";
print (strstr($ping, '1 packets transmitted, 1 received'))
? '<var style="color:#090;background:#cfc">UP</var>'
: '<var style="color:#900;background:#fcc">DOWN</var>';
?>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top