I use php includes for the header and footer on every page of my site. And I want to use these same files at my guestbook. I'm trying to use Carbonize's method of including my site's header and footer files into the guestbook index.php file via includes. But how do I get the javascript that is needed for the guestbook into my own header file without that javascript appearing in my source code for every other page on my site?
PS - I was going to post this in the advanced guestbook forum, but it said I had to register first.
12/05/2005 23:48:37
Subject:
Carbonize
Master
Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline
Nothing I can do about that forum requiring membership, I'm just a moderator. Anyway you could remove all surplus HTML from the header.php file so all that is left is javascript and then use the includes method. I must state that the includes method (putting the include code at the top and bottom of index.php etc) will cause an error when posting comments.
Carbonize I am not the maker of the Advanced Guestbook
I just looked closer at your guestbook. And it looks like you have the javascript in the body of your html. I was thinking it had to go in the head section with style and meta tags; hence, my original post. Anyway, I think I'm going to just put the javascript at the very top of the body.php of the guestbook templates.
Thanks.
PS - any reason why using includes causes error when posting comments? Does it completely prevent posting comments or just give an error message?
13/05/2005 00:06:02
Subject:
Carbonize
Master
Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline
Because the guestbook uses a header to send the poster back to the guestbook after they have posted.
Carbonize I am not the maker of the Advanced Guestbook