On Mar 14, 2011, at 1:15 AM, atelier wrote:
I have two problems with the action.
1)
My encoding of the page is:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
But often I get a mail back that looks like this:
meg igjen når våren
and that should be:
meg igen när våren
This is down to PHP set to run in Windows-latin mode, rather than
UTF-8 mode, but your form set to accept UTF-8 input. One of the
simplest things to try here is to open up your form handler in a
programmer’s text editor (like TextWrangler) and change its file
encoding to UTF-8 (No BOM) or just UTF-8 if your editor doesn’t offer
the choice of No BOM. (BOM stands for Byte Order Marker, and is one
way by which Unicode text files signal their character encoding to
processing applications.) If that alone is enough to allow the
characters to be properly encoded, then you’re all set. If not, then
you’ll need to up the ante a bit with a PHP configuration command. Add
this line right after the opening <?php in your form handler:
mb_internal_encoding("utf-8");
…and see if that does the trick.
and 2)
i have settngs that I want to have returned the IP adress, but this
field is always empty.
Are you doing this with some PHP on your form page, maybe setting a
hidden form field to $_SERVER[‘REMOTE_ADDR’] or something like that?
You may need to try:
if (getenv("HTTP_X_FORWARDED_FOR")) {
$ip=getenv("HTTP_X_FORWARDED_FOR");
}else {
$ip=getenv("REMOTE_ADDR");
}
…since some of your visitors may be hiding behind a proxy or two.
Walter
What causes, and what could solve these problems?
Thanks.
Hans
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options