Return to "View Guestbook" page after the Submitio

More
18 years 2 months ago #177 by leftezi
Is there a way that the visitor return automaticaly in the "View Guestbook" page
after a succecfull submition entry?

Please Log in or Create an account to join the conversation.

More
18 years 2 months ago #178 by Pete
Hey bud,

You can not re-direct using PHP once the page header is loaded. If you need to redirect the user after entry is added, you could use:
Code:
<meta HTTP-EQUIV="REFRESH" content="20; rl=http://www.yourdomain.com/index.html">

Where 20 is the number of seconds you wish the user to wait before it re-directs them to the destination page.

DigiOz Webmaster
www.digioz.com

Please Log in or Create an account to join the conversation.

More
18 years 2 months ago #179 by leftezi
Thanks Pete
This code would redirect the visitor in my homepage (index) startpage.
But i want (after entry is added) that he returns in the "View Guestbook" page where he can read all messages including his new entry.

A Code like this:

<meta HTTP-EQUIV="REFRESH" content="1; rl=http://www.mydomain.com/guestbook/list.php?page=1&order=asc">

would be right?

But
Where exactly should i put this code? In which file and line?

Please Log in or Create an account to join the conversation.

More
18 years 2 months ago #182 by Pete

leftezi wrote: Thanks Pete
This code would redirect the visitor in my homepage (index) startpage.
But i want (after entry is added) that he returns in the "View Guestbook" page where he can read all messages including his new entry.

A Code like this:

<meta HTTP-EQUIV="REFRESH" content="1; rl=http://www.mydomain.com/guestbook/list.php?page=1&order=asc">

would be right?

But
Where exactly should i put this code? In which file and line?


Your code is correct. As to where to put this code, it should go between the <head> and </head> tags in your "header.php" file. You will need to add some PHP logic to the above however, to only show the above HTML code if the current page is "add.php". I will post that for you shortly.

DigiOz Webmaster
www.digioz.com

Please Log in or Create an account to join the conversation.

More
18 years 1 month ago #184 by Pete
Here is what you need. Open the file "header.php", and replace the following:
Code:
<head> <title>DigiOz.com - Guestbook Version 1.7</title> <link rel="STYLESHEET" type="text/css" href="style.css"> </head>

With this:
Code:
<head> <title>DigiOz.com - Guestbook Version 1.7</title> <?php if (basename($_SERVER['PHP_SELF']) == "add.php") { echo '<meta HTTP-EQUIV="REFRESH" content="5; url=list.php?page=1&order=asc">'; } ?> <link rel="STYLESHEET" type="text/css" href="style.css"> </head>

I set the redirect waiting time to 5 seconds. Feel free to change that as needed.

DigiOz Webmaster
www.digioz.com

Please Log in or Create an account to join the conversation.

More
18 years 1 month ago #186 by leftezi
Thanks a lot, Pete
It works fine.
:D

Please Log in or Create an account to join the conversation.

Time to create page: 0.124 seconds
Powered by Kunena Forum