encoding not good, IP adress missing in PHP FeedbackForm Action

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

and 2)
i have settngs that I want to have returned the IP adress, but this field is always empty.

What causes, and what could solve these problems?

Thanks.

Hans


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

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

Thanks Walter
I’ll try tis out as soon as I’m home (on the road just now)
'll be back here to report.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Walter

(some time later)

I am afraid i cannot change anything in the formhandler, I use the PHP Feed Back Action, and so the file on the server gets overwritten…

About the second part in my question, the getting of the IP adress is part of a settings in the form, do not know how that works…


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I use the PHP Feed Back Action, and so the file on the server gets overwritten……….

To avoid this set up your form with PHPFF action and publish.

Open the action generated whatever-go file in a text editor and save it as something like myformhandler.php

Now remove the PHPFF action from your page and instead set up Page>Form Setup to point to your myformhandler.php page (Post: mydomain/myformhandler.php) You will need to upload myformhandler.php to the server.

Now you can edit myformhandler.php as much as you like without fear that FW or the action will overwrite it.

If you subsequently change any of the form fields in FW you will need to repeat the process.

D


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks a lot, DeltaDave.
That I could not think of this myself…;-(

Sometimes the habit of ‘Freeway thinking’ keeps one from leaving the comfortable ‘highway’ and taking the other somewhat more difficult road instead…


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options