I have a guestbook, wehn the user posts a comment, it will say "posted" then I want the page to wait 2-3 seconds and redirect back to the page showing the comments, how would I do this? I think these forums do that when I post.
ok these forums go to the 'view entry''s' page but how would I maKe it redirect automatically.
Making the page wait a few seconds then redirect
Moderator: General Moderators
From some website I found on google:
So, if you want to direct them to page x, just generate the URL dynamically.<META HTTP-EQUIV=Refresh CONTENT="10; URL=http://www.htmlhelp.com/">
tells the browser to load http://www.htmlhelp.com/ 10 seconds after the current document has finished loading. Not all browsers support this, so authors should provide an alternate means of moving to the new page where necessary. The Refresh header is sometimes used for "splash screens" or when a page has moved, but the technique is not very effective since users may not even be looking at the window that is to be refreshed and since it messes up the user's history on many browsers. Some search engines penalize pages that use a Refresh of a few seconds or less.
use meta, or use php
Thats how i would do it.
Code: Select all
<?php header( "Refresh: 3; url=the url" ); ?>oh yeah, forgot about the header function...bit rusty on my php. Newbies always have trouble with it though, because they don't realize that you must send a header before *any* HTML gets sent to the client. This is becuause header($string) adds string to the HTTP response header sent by the server to the client, and most newbs don't know an HTTP header from a tomato.
That's why I prefer to tell them to dynamically generate the meta tag.
That's why I prefer to tell them to dynamically generate the meta tag.