include Gbook in existing html webpage

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
wimaka
Posts: 9
Joined: Thu Apr 01, 2010 3:59 pm

include Gbook in existing html webpage

Post by wimaka »

For days now, I have tried to include Gbook into my gastenboek.html page. But it won't work. What am I doing wrong?
At first it worked with an iframe, but then the page in IE dropped down.
I have tried to do it with all different ways: with overall_header.php, header.txt and footer.txt and with header.php, foorter.php, etc. I have renamed my page to: gastenboek.php, but that won't work either.
Now I am back to zero...
Can you tell me the steps to do? Is it necceccary to adjust something in gbook.php, so it is visible with include?
This is my last version:

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
   "http://www.w3.org/TR/html4/strict.dtd">
<html lang="nl">
<head>
<meta http-equiv="Page-Enter" content="blendTrans(Duration=8.0)">
<title>gastenboek</title>
<link rel="icon" type="image/vnd.microsoft.icon" href="http://www.cakejoy.nl/favicon.ico">
<link rel="stylesheet" type="text/css" href="opmaak.css">
<script type="text/javascript" src="paginafadein.js"></script>
<style type="text/css">
<!--
.stijl3 {font-size: smaller}
-->
</style>
</head>
<body onload="fadeInit();fadeIn();">
<?include("gbook/gbook.php");?>
</body>
</html>
In stead of: <?include("gbook/gbook.php");?> I have tried: #GBOOK#, but that didn't worked at all!
I hope you can help me!
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

Hello wimaka,

As far as I know GBook is not designed to be used by including it with the include function. It probably can be done by changing the code, but I myself would not know how to do it.

I just tested it with the Iframe script as mentioned in the following post viewtopic.php?t=1684 and it works fine in IE(7) and Firefox.
What IE version did it not work in? And did you use this Iframe script, or just a simple Iframe?

Groeten,
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.
wimaka
Posts: 9
Joined: Thu Apr 01, 2010 3:59 pm

Post by wimaka »

Thank you for your answer!
Oops, I spend a week by trying getting it to work with includes and now you say it can't be done that way! I wanted to do it with includes, because I use the Strict-doc type and you cannot use frames then. And I still don’t understand why the #GBOOK# way didn’t worked!
In IE 8 the page dropped down when I used:

Code: Select all

 <iframe src="gbook/gbook.php" width="650" height="800" align="middle" scrolling="yes"
I have followed your suggestion and inserted the script and:

Code: Select all

<iframe id="myframe" src="gbook/gbook.php" scrolling="no" marginwidth="1" marginheight="1" frameborder="0" style="overflow:visible; width:100%; display:none" name="Guestbook"></iframe>

But because of the doc type Strict it gave 11 errors! So I changed the 'gastenboek' page to: doc type ‘Transitional' and now the errors are gone!
I have another question:
I want to change the white color of the 5 text fields, where the visitors can add their names, etc. and change the text color and font. I can only change the background-color of the textarea in style.css. I tried all possibilities in style.css and searched the hole forum, but cannot find it.
Do you know how to do this?
Thanks again!
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

Hello wimake,

I hope Klemen will read this and say that I am wrong and that GBook can be included by using the include function without to much trouble (I would like to use it that way myself too). But I think that is not the case.

Indeed, iframes can not be used in strict doctype. But than again, GBook is written to be xhtml 1.0 transitional valid, so it could be that it still would not validate even by using the include tag.

For adding the styles you like, add following to your style.css and change the content of the style to your liking

Code: Select all

div.gbook_right input {background-color: yellow; color: red; font-style: italic;} 
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.
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Unfortunately GBook won't work as an include as it relies on PHP sessions and these are usually broken (http headers sent before the gbook session headers) when using includes, especially if the goal of an include is to include it in another HTML template.

You will have to either modify the templates or use header.txt/footer.txt files respectively.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
wimaka
Posts: 9
Joined: Thu Apr 01, 2010 3:59 pm

Post by wimaka »

Thanks Henrie and Klemen for your answers!
Klemen: I inserted GBook to my own HTML page and changed that page to doc type transitional. It works, so I leave it like this.
Henrie: About changing the white text fields: I’ve paste the code you gave me and that worked fine for the first 3. But the text field where visitors have to answer the anti-spam question and the field where they have to type the numbers are still white.
I have tried it with other div’s , like p.e.

Code: Select all

 div.gbook_anti_spam_anwer  input
, etc. , but I can’t get it to work. Maybe I have been searching and trying too long ……
Can you please help me again?
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

Hello wimaka,

For finding what element I have to apply the style to I use the Web Developer Toolbar Add-on in Firefox, function: Information > Display Element Information (Ctrl+Shift+F)
In Internet Explorer 7 you can use the IE Developer Toolbar (Tools > Toolbars > Explorer bar > IE Developer Toolbar) (route to it could have different names, because i translated from dutch version).
In Internet Explorer 8 you can use the Development tools (F12) (Tools > Development Tools)

Now for your question:
For the spam question and security code input field

Code: Select all

.gbook_bottom_images input {background-color: yellow; color: red; font-style: italic;} 
or if you want all input fields to look the same, just use

Code: Select all

input {background-color: yellow; color: red; font-style: italic;}
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.
wimaka
Posts: 9
Joined: Thu Apr 01, 2010 3:59 pm

Post by wimaka »

Hello Henrie,

Thanks for your fast answer. I already used the Web Developer Toolbar for validation, but didn’t know how to use the Element Information, so many thanks for pointing that out to me!
In the meantime I have adjusted my guestbook and now it looks just great! And the website is finished and working fine.
Thanks both for your help!
I have subscribed to the newsletter, so I keep informed!
psychposse
Posts: 2
Joined: Wed Jun 09, 2010 6:38 pm

Happy

Post by psychposse »

:D

Glad I found this site, the GB and more specifically, this thread.

I am so happy that I feel like buying you all enough beers to get quite intoxicated :o

Thank you for the GB.

I am really just an amateur at web, only know basic html, so I do hope my gb works for anyone who views it :lol:

Only problem I found so far is sometimes the security image doesn't show up but by clicking the Sign Guestbook link again (a refresh) it shows the security image. I am thinking this might be an issue with my slow satellite net.

Thanks again!

http://www.merletucker.org/guestbook/default.html
Post Reply