SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2002
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can't control page refresh rate

    Hi All

    I am trying to create a page that will automatically refresh itself after a sort period of time. I have used meta tags to acheive this effect and it works well on both linux and OSX. The problem is that under windows IE the page refreshes so quickly that it is impossible to see anything. It appears that IE completely ignores the time delay setting in the refresh header. I have tried using both <meta> tags and header() but the result is the same. Is the refresh <meta> tag incompatable with IE?

    regards, Ben

    Code:
    <?php
    	error_reporting(E_ALL);
    	//header('refresh', '10; url=adsl-cpanel.php');
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="refresh" content="10; url=adsl-cpanel.php">
    <title>ADSL Control Panel</title>
    <style type="text/css">
    .status {
    	position: absolute;
    	border-width: 2px;
    	border-style: solid;
    	border-color: black;
    	padding: 10px;
    	background-color: #f3f3f3;
    }
    </style>
    
    </head>
    <body>
    	<div style="position: absolute; top: 20px; left: 20px; height: auto; width: auto;">
    <?php
    	/* Determine if connection exists */
    	//echo exec("/sbin/ifconfig ppp0");
    	$adsl_status = exec('/sbin/ifconfig ppp0 > /dev/null; echo $?');
    	if ($adsl_status == 0)
    	{
    		$image = 'adsl_on.jpg';	
    		$status_text = "ADSL connected";	
    	}
    	else
    	{
    		$image = 'adsl_off.jpg';
    		$status_text = "ADSL not connected";
    	}
    ?>
    		<h2>ADSL CONNECTION</h2><br>
    		<div class="status">
    			<img class="status_light" src="<?php echo $image; ?>" height="20" width="20">&nbsp;<?php echo $status_text; ?><br>
    		<div>
    		<div style="position: absolute; top: 100px; left: 0px;">
    			<a href="adsl-onoff.php?status=<?php echo $adsl_status; ?>"><img class="onoff" src="button.gif">&nbsp;Start/Stop ADSL Connection</a>
    		</div>	
    	</div>
    </body>
    </html>
    Experience is that thing which lets you know you've made the same mistake yet again.

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Meta refresh works fine in IE, and always has as far as I know. Your meta refresh as above works for me in Firebird and IE6 both taking the same 10 seconds before refreshing.

  3. #3
    Forensic SEO Consultant Webnauts's Avatar
    Join Date
    Jun 2003
    Location
    European Union
    Posts
    1,488
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I regret to inform you, that the redirect solution you are using is not ok.

    Why?

    See here: http://www.w3.org/2001/06tips/reback

  4. #4
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    If you're going to take a standpoint, I'll take one too. Sending a 301 header pointing to the same page makes no sense and is LYING TO THE USER. There was no permanent move of the page.

    Not to mention, your solution does not solve his problem of wanting to redirect after a specific amount of time.

  5. #5
    Forensic SEO Consultant Webnauts's Avatar
    Join Date
    Jun 2003
    Location
    European Union
    Posts
    1,488
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dan Grossman
    If you're going to take a standpoint, I'll take one too. Sending a 301 header pointing to the same page makes no sense and is LYING TO THE USER. There was no permanent move of the page.

    Not to mention, your solution does not solve his problem of wanting to redirect after a specific amount of time.
    You are right. I missed that point. Well I guess it would be better using JavaScript, if there is a concern of SEO.

  6. #6
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I'm quite evil.

  7. #7
    SitePoint Addict Viral's Avatar
    Join Date
    Nov 2001
    Location
    Washington DC
    Posts
    294
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That meta refresh is exactly right. If it doesn't work for you, there's something wrong with your browser. What does it do when you load that page?

    As for the redirect, that is a valid point if he were redirecting, which he's not. =)

    --Viral
    A computer without Windows is like a chocolate cake without mustard.

  8. #8
    SitePoint Zealot
    Join Date
    Feb 2002
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually I have found the issue. This page does in fact work as intented. The issue turned out to be with a page that redirects the browser to the one posted here. What I did was create an "index.html" page that would automatically redirect the browser to the page posted here. I used the same headers technique to do the forwarding. I did not want to use JavaScript because I was concerned about people that have JS turned off. As I originally mentioned, everything was working fine on my Linux box, but windows IE 5.5/6 would just go mental everytime it hit that index page. This is why I thought there might have been compatability problems. Unfortunately I can't post the code right now as I don't have access to my machine.

    Regards, Ben
    Experience is that thing which lets you know you've made the same mistake yet again.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •