[FX.php List] - using fm_and_php gives character problems

William Downs william.downs at gmail.com
Fri Mar 27 12:16:41 MDT 2009


Hi guys,

I am having a problem with special characters -

1) I have a reg.php page for registration - contains a form (amongst
other stuff, validation etc)
2) If validated, then the data is sent to Filemaker 9 Server, Mac OS
X, Apache) where it creates a new Customer record
3) This happens per the FM_and_PHP class (not my choosing, I would
rather use FX of course.)
3) HOWEVER, IF the data contains umlaut, and much of it does as it is
for a German company, then the umlaut has disappeared and in its place
is some rubbish ( example, instead of Müllmann, it will say Möllman )
I saw this by having the DB open, and once the registration successful
dialoge page was presented, looked at the record in Filemaker - this
is of course the garbage that the web user also sees
4) The only way I can get round this is to use utf8_decode around
EVERY single value that is to be sent to the Filemaker DB

Example  :

	$FM = new FM_and_PHP();
	    $FM->setFileMakerHost("127.0.0.1","80",'7');
	    $FM->setDatabaseUserPassword("webUser","webPassword");
	    $FM->setDatabaseName('Customer');
	    $FM->setDatabaseLayout('CustomerWeb');
	    $FM->setCommand("new");
	    $FM->addParameter('Name',utf8_decode($_POST['name']));
	    $FM->addParameter('Vorname',utf8_decode($_POST['vorname']));
	    $FM->addParameter('Strasse',utf8_decode($_POST['strasse']));

etc, etc - I have to do it for every field that may contain Umlaut -
i.e. every text field.

Surely this is NOT the correct way ?

1) I have a .php page open in BBEdit 9.1.1
2) At the bottom of the page, I have the page in Unicode (UTF-8, no BOM)

Where is this going wrong ? Or is this indeed what one must do in
order to get special characters into the DB ?

Perplexed and puzzled -

William


More information about the FX.php_List mailing list