Jump to content

redirecting a page other than using meta?


codrgii

Recommended Posts

If you mean 5 seconds after the page is displayed in the browser - yes, but it can't be done with php alone. There 2 other ways: javascript and ajax. But if you use javascript, there's no point in using ajax to interface with php.

 

SO, javascript lol

 

http://codesnippets.joyent.com/posts/show/123

 

Hope that helps.

 

You can't do this with php because the php script is run BEFORE the html output - so only ajax could bridge that gap. To explain better, say you want to redirect 5 seconds after a form is submitted using php - all the user will see is a redirect after 5 seconds. There will be no output during that time and you can't produce a 'this will redirect in 5 seconds' then have php redirect. That's why you'd have to use javascript or ajax.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.