Guestbook

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
Ove
Posts: 1
Joined: Wed Feb 25, 2015 2:39 pm

Guestbook

Post by Ove »

Script URL:
Version of script:
Hosting company: One.com
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:

Write your message below:
After an update of the php version to PHP 5.6 at my website my guestbook is not working properly any longer. It is not possible to post messages containing the Swedish charactes å,ä,ö. Messages with only english letters are let through, though. What shall I do so that messages to the guestbook containing Swedish characters are let through too? Thanks and best regards. Ove
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: Guestbook

Post by Klemen »

This is because as of version 5.6 PHP outputs a HTTP header containing the default_charset set in the php.ini file (PHP has actually become a nightmare for anyone not using UTF-8 since version 5.4 onwards...).

In other words - GBook tells your browser to use one encoding, but PHP sends a header saying it is in a different encoding and the browser listen to the HTTP header instead of the GBook HTML source.

Try this:
1. open settings.php file
2. add this to the bottom:

Code: Select all

header('Content-Type: text/html; charset=windows-1250');
3. close all browser windows
4. open guestbook

Does this fix the OLD messages (messages posted BEFORE you updated PHP) and any new messages you post?

A problem will remain - your last few messages have been posted in UTF-8 encoding, so you actually have two different encodings in a single file...
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
Post Reply