[FX.php List] Spaces in Field Names...one more time with gusto

Troy Meyers tcmeyers at troymeyers.com
Tue Dec 9 16:13:41 MST 2008


Yes, if this is a self-generating form, then the naming of the input fields should deal spaces and other characters in a predictable way, that can be deciphered on the PHP page that receives the POST data.

The thing that I think is the problem is that the FileMaker field names must be exactly as they are in the database. If the form's input field becomes name="Alpha_Beta" then the PHP that generates the AddDBParam() instances must have the FileMaker field name as 'Alpha Beta' since that's really what it is in FileMaker. This can either be done by looping through the $_POST array or by rote programming.

My point is that the encoding or altering of the name of the <input /> is what's needed, NOT the FileMaker field name, neither in the database nor the field name specification in the AddDBParam() function.

Maybe I'm wrong, but Jonathan, aren't you changing it there?

If the FileMaker field names are being recreated from the POST data on the fly, then they must be DEcoded as appropriate to how they were ENcoded on the page the generates the original form.

-Troy



> I'll point out that this is probably a heck of a lot of rote code to  
> write for what appears to be a generic engine for anyone's database.  
> Then again, doing this means that there must be some kind of 'special  
> character' management for all FMP field names. As another pointed out,  
> spaces won't be the only problem. I'd start with the previously  
> recommended urlencode() function, and go from there.



More information about the FX.php_List mailing list