Hi,

I been using a function for past few months that refreshes or redirects a user after xx time, for example after logging in etc.

It workes fine in FireFox but notice that in IE7/IE8 and Google Chrome it does not redirect.

I checked in IE and it is enabled in security, and Google is a complete failure and Firefox it works.

This is the function, i use it througout my site and i dread having to do something else as it means editing allot of files.

// Redirect Function
			function redirect( $addr , $time=false ) {
			if( isset( $time ) ) {
			echo '<meta http-equiv="refresh" content="'.$time.'; URL='.$addr.'" />';
			} else {
			echo '<meta http-equiv="refresh" content="0; URL='.$addr.'" />';
			}
}

Basicall when i want to redirect i put where ever in my code i want it:

redirect ("index.php", "3");

It seems meta refresh has either died or is just not reliable.

Anyone suggest what else i can do?

I also tried on another computer and same thing. I really wish there was only one browser and that is FireFox lol, it would save so much time for developers and web designers.

I know i could use Java Script, but this is not really what i want as it is just as non reliable if a user has Java Script disabled.

Thanks
Mat

I have used re-directs without any problem that I'm aware of in any of the browsers. I use them on a couple of sites that re-direct in the initial index module to a sub-domain so it gets used a lot.

In my case, I used a version of the following lines:

<META NAME="GENERATOR" CONTENT="xxxxx">
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<meta http-equiv="refresh" content="2;URL=http://....php"

The first one is basically a comment so it shouldn't matter. Maybe the Pragma make a difference.

Hi,

Thanks for reply i tried the praga and it wont work,

I cant understand why this is happening.

I use it throughout my scripts in different places in the scripts.

maybe someone else got any ideas?

Thanks
Mat

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.