Webmaster Tuhy Posted July 4, 2006 Share Posted July 4, 2006 does anybody know how to redirect one page to another in like five or ten seconds?i'm not sure if it's html, xhtml, java, css, etc...can anybody help? Link to comment Share on other sites More sharing options...
reportingsjr Posted July 4, 2006 Share Posted July 4, 2006 Its html... <meta HTTP-equiv="refresh" content="0;url=http://www.w3schools.com";> in content, the 0; part is how soon to redirect the page (in seconds) and the url=blahblah; is what url to redirect to. Hope this is the kind of redirect you want, this will just change the page.. or you could do it in javascript, like this.. <script language="javascript" type="text/javascript">window.location="http://www.w3schools.com";</script> Im not sure how to put a timer on that one though.. maybe someone else who actually knows javascript can Link to comment Share on other sites More sharing options...
scott100 Posted July 4, 2006 Share Posted July 4, 2006 Im not sure how to put a timer on that one though.. maybe someone else who actually knows javascript can setTimeOut would do it, but i think the meta tag is better choice Link to comment Share on other sites More sharing options...
Webmaster Tuhy Posted July 4, 2006 Author Share Posted July 4, 2006 thanks, that help alot Link to comment Share on other sites More sharing options...
Jack McKalling Posted July 5, 2006 Share Posted July 5, 2006 I remember this socalled meta-refresh can be shut down by the client, whether by a setting or an action, but I can't be sure.I would choose for a javascript with a link to manual redirect (for when it doesn't work), or another way of the system that doesn't need a redirect.. :)But it is your choice Link to comment Share on other sites More sharing options...
aspnetguy Posted July 5, 2006 Share Posted July 5, 2006 I highly doubt the user can effect the meta settings of your page and even if they can they can shut down javascript far more easily. Link to comment Share on other sites More sharing options...
w3rss Posted July 5, 2006 Share Posted July 5, 2006 PHP?<?header('Refresh:5; URL=url');?> Link to comment Share on other sites More sharing options...
Jack McKalling Posted July 5, 2006 Share Posted July 5, 2006 That is what I said, use another way within your system, such as a php redirect.Javascript is only client-side, which means the user will see the page that redirects, with php he cannot. Link to comment Share on other sites More sharing options...
Skemcin Posted July 5, 2006 Share Posted July 5, 2006 p.s. if you still want any search engine to recognize the page you are redirection from, you should set your redirect to at least 15 seconds. If not, then a redirect is always better to be done on the server side - if possible. If you're stuck in static (X)HTML, then the meta tasg is best used for this. Link to comment Share on other sites More sharing options...
aspnetguy Posted July 5, 2006 Share Posted July 5, 2006 That is what I said, use another way within your system, such as a php redirect.Javascript is only client-side, which means the user will see the page that redirects, with php he cannot. <{POST_SNAPBACK}> Sorry Dan, your post was hard to read and I thought you were saying you would choose a javascript method.Yes a server side redirect would be best. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now