Page 1 of 1

How to put a delay in front of a meta refresh?

Posted: Mon Dec 05, 2005 3:05 pm
by davidprogramer
Subject says it all. I am trying to a put a delay so they can see the error message before the page refreshes.

Code: Select all

if ($removed_player == $your_playerid){
				echo "You can't remove yourself without first promoting someone else to clan owner.";
				echo "<meta http-equiv=\"refresh\" content=\"N; URL=modules.php?name=League&file=clan_info&lid=$current_ladder&cid=$clan_id\">";
				die();
			}

Posted: Mon Dec 05, 2005 3:06 pm
by Chris Corbyn
LOL... Did you copy and paste this? :P

Code: Select all

echo "<meta http-equiv=\"refresh\" content=\"N; URL=modules.php?name=League&file=clan_info&lid=$current_ladder&cid=$clan_id\">"
The value of "N" is the number seconds before the refresh.. i.e.

Code: Select all

echo "<meta http-equiv=\"refresh\" content=\"10; URL=modules.php?name=League&file=clan_info&lid=$current_ladder&cid=$clan_id\">"

Re: How to put a delay in front of a meta refresh?

Posted: Mon Dec 05, 2005 3:06 pm
by foobar
You almost have the answer right there in your post!

Code: Select all

if ($removed_player == $your_playerid){
				echo "You can't remove yourself without first promoting someone else to clan owner.";
				echo "<meta http-equiv=\"refresh\" content=\"5; URL=modules.php?name=League&file=clan_info&lid=$current_ladder&cid=$clan_id\">";
				die();
			}
Replaced the N in your meta refresh tag with 5 so it delays refreshing to 5 seconds.

[edit] Damn... this time it was me... :P

Posted: Mon Dec 05, 2005 3:10 pm
by davidprogramer
You have no idea how embarassing this is -_-