Message to appear on the 'View Guestbook' pages only

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
Annie
Posts: 20
Joined: Sat May 15, 2010 5:08 pm

Message to appear on the 'View Guestbook' pages only

Post by Annie »

Script URL: http://www.hibbitt.org.uk/guestbook/gbook.php
Version of script: 1.7
Hosting company: AddAction
URL of phpinfo.php: http://www.hibbitt.org.uk/phpinfo.php
URL of session_test.php:
What terms did you try when SEARCHING for a solution: comments add text, additional text

Write your message below:

Hi,

Just getting to grips with this script and loving it. I have a question.

Is it possible to show a short message which will appear on the pages where you view the guestbook only, ie. I don't particularly want the message in the header.txt or overall_header because I don't want to see it on the Sign Guestbook or Admin pages. If you go to my guestbook at http://www.hibbitt.org.uk/guestbook/gbook.php I'm referring to the introduction text under The Guestbook heading. I tried placing it in the comments file but it appears with every comment so that's no good.

I don't really know php so some guidance would be greatly appreciated.
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

Hello Annie,

To do this you can change overall_header.txt
Change

Code: Select all

<!--CUSTOM HEADER -->
<?php
include('header.txt');
?>
<!--CUSTOM HEADER END -->
to

Code: Select all

<!--CUSTOM HEADER -->
<?php
include('header.txt');
/* Get the action parameter */
$a = isset($_REQUEST['a']) ? gbook_input($_REQUEST['a']) : '';
if (empty($a)) {
echo 'Text only to be displayed on the view guestbook page.<br />';
}
?>
<!--CUSTOM HEADER END -->
Just be carefull not to use single quotes in your text line. Or if you have to, escape them using a backslash (\')

Greetings,
Henrie
I do not monitor the Gbook forums regularly anymore since I do not use the Gbook script myself anymore for a long time. But it helped me a lot in learning to understand php.
Annie
Posts: 20
Joined: Sat May 15, 2010 5:08 pm

Post by Annie »

Thank you once again Henrie. I'm all set now.

Cheers, Annie
Post Reply