Making a "In-between" confirmation page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
seodevhead
Forum Regular
Posts: 705
Joined: Sat Oct 08, 2005 8:18 pm
Location: Windermere, FL

Making a "In-between" confirmation page

Post by seodevhead »

I have a script that acts much like a message board. When someone posts a message, I would like a quick "confirmation" page to come up, much like a lot of forums do, where it will say something like "Your message has been posted... You are being redirected to your post", and then after a 3 second delay, redirect them to their post.

How is this done? Is there any pitfall to having your script setup this way? Thanks for any help. Take care.
User avatar
Nathaniel
Forum Contributor
Posts: 396
Joined: Wed Aug 31, 2005 5:58 pm
Location: Arkansas, USA

Post by Nathaniel »

Something like (semi-pseudocode)

Code: Select all

if ( MESSAGE_POSTED )
{
    header("Refresh:3; URL=$url_to_post");
    echo "your message has been posted";
}
Note that the the Refresh header isn't part of the http specification, and you might want to look into using javascript or the meta refresh tag. Also, I think there is some server (IIS?) that the Refresh header doesn't work on.

But no, there shouldn't be a problem with what you want to do.

- Nathaniel
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Just do a page level redirection with meta tags and a in-page link for the impatient. As Nathaniel said, the header refresh isn't in the specs nor is it supported on some web servers and some browsers as well.
User avatar
seodevhead
Forum Regular
Posts: 705
Joined: Sat Oct 08, 2005 8:18 pm
Location: Windermere, FL

Post by seodevhead »

feyd wrote:Just do a page level redirection with meta tags and a in-page link for the impatient. As Nathaniel said, the header refresh isn't in the specs nor is it supported on some web servers and some browsers as well.
Thanks for the help guys... as for the meta refresh.... is there a way to set a 3 sec delay with that? How is that usually done? JS?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

User avatar
seodevhead
Forum Regular
Posts: 705
Joined: Sat Oct 08, 2005 8:18 pm
Location: Windermere, FL

Post by seodevhead »

You're the man feyd. Much oblige!
Post Reply