Jump to content


Photo

Display and redirect!


  • Please log in to reply
4 replies to this topic

#1 mccanna

mccanna
  • Members
  • Pip
  • Newbie
  • 2 posts
  • LocationIreland

Posted 22 March 2006 - 03:26 PM

Is it possible to display a php page for 3 or 4 seconds and then redirect the user back to the main menu page? If so, could you give a simple example or suggest an appropriate tutorial?

#2 snowdog

snowdog
  • Members
  • PipPipPip
  • Advanced Member
  • 107 posts

Posted 22 March 2006 - 07:04 PM

put this on the bottom of tha page you want displayed for xx seconds.

$sec = 5; // number of seconds until redirect
header("Refresh: $sec; url=http://www.yoururl.php");



Snowdog


[!--quoteo(post=357314:date=Mar 22 2006, 10:26 AM:name=AMcC)--][div class=\'quotetop\']QUOTE(AMcC @ Mar 22 2006, 10:26 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Is it possible to display a php page for 3 or 4 seconds and then redirect the user back to the main menu page? If so, could you give a simple example or suggest an appropriate tutorial?
[/quote]

#3 mccanna

mccanna
  • Members
  • Pip
  • Newbie
  • 2 posts
  • LocationIreland

Posted 27 March 2006 - 09:24 AM

Perfect! Thanking you!
[!--quoteo(post=357364:date=Mar 22 2006, 08:04 PM:name=snowdog)--][div class=\'quotetop\']QUOTE(snowdog @ Mar 22 2006, 08:04 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
put this on the bottom of tha page you want displayed for xx seconds.

$sec = 5; // number of seconds until redirect
header("Refresh: $sec; url=http://www.yoururl.php");
Snowdog
[/quote]


#4 Seamless

Seamless
  • Members
  • PipPip
  • Member
  • 25 posts

Posted 27 March 2006 - 09:37 AM

[!--quoteo(post=357314:date=Mar 22 2006, 10:26 AM:name=AMcC)--][div class=\'quotetop\']QUOTE(AMcC @ Mar 22 2006, 10:26 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Is it possible to display a php page for 3 or 4 seconds and then redirect the user back to the main menu page? If so, could you give a simple example or suggest an appropriate tutorial?
[/quote]


Yes, you can use a meta refresh

<meta http-equiv="Refresh" content="3; URL=http://www.yourdomain.com/yourpage.php" >

where 3 is the amount of seconds you want to display the page for.

Seamless

seems like i need to refresh my page more :P

#5 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 27 March 2006 - 10:13 AM

[!--quoteo(post=358812:date=Mar 27 2006, 10:24 AM:name=AMcC)--][div class=\'quotetop\']QUOTE(AMcC @ Mar 27 2006, 10:24 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Perfect! Thanking you!
[!--quoteo(post=0:date=Mar 22 2006, 08:04 PM:name=snowdog)--][div class=\'quotetop\']QUOTE(snowdog @ Mar 22 2006, 08:04 PM)[/div][div class=\'quotemain\'][!--quotec--]
put this on the bottom of tha page you want displayed for xx seconds.

$sec = 5; // number of seconds until redirect
header("Refresh: $sec; url=http://www.yoururl.php");
Snowdog[/quote]
[/quote]
Make sure you use the header function before the output of any text/html otherwise PHP will report back a warning error and your script wont run.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users