php and filepro apostrophe

Bill Randall wrandall at fptech.com
Fri Jun 2 08:56:37 PDT 2006


----- Original Message ----- 
From: "Richard D. Williams" <richard at appgrp.net>
To: "filePro Mailing List" <filepro-list at lists.celestial.com>
Sent: Friday, June 02, 2006 11:29 AM
Subject: OT: php and filepro apostrophe


> This relates to a previous post about converting apostrophes.  I never
> could get an edit to perform this function.
>
> I have a problem passing apostrophes from a filepro generated text file
> to a php web page.
>
> example:
> a field in the text file is D'Alton.
> I use php to get read this text field, parse it into php variables.
>
> The text file contains a subject_name of D'Alton.
> The apostrophe is there is the filepro text file and after using php
> commands list and split to parse the field values into php variable, the
> php variable contains D'Alton as well.
>
> But, here is the problem.  The html line,
> <input type='text' name='subject_name' value='$subject_name'>
> result in just the letter D in the text box.  Everything after the
> apostrophe and the apostrophe is gone.
>
> I tried using addslashes to convert the php variable subject_name value
> to D\'Alton.  But it just result with D\ being placed into the html text
> box.
>
> Does anyone have any suggestions.
>
> This is very urgent,
>

I don't know if PHP uses the same syntax as XML but in some XML coding that 
I had to do I had to strip out certain characters from the text in order for 
it to be rendered properly in the XML page.

::sp="1":
putlp1:::
::zz=instr(dx,"&",sp):
::ln=len(dx){"";sp=zz+"1":
:zz ne "0":dx=mid(dx,"1",zz-"1")&"&amp;"&mid(dx,zz+"1",ln) ; goto putlp1:
::sp="1":
putlp2:::
::zz=instr(dx,"'",sp):
::ln=len(dx){"";sp=zz+"1":
:zz ne "0":dx=mid(dx,"1",zz-"1")&"&apos;"&mid(dx,zz+"1",ln) ; goto putlp2:
::sp="1":
putlp3:::
:'noquot eq "Y":goto putlp4:
::zz=instr(dx,"\"",sp):
::ln=len(dx){"";sp=zz+"1":
:zz ne "0":dx=mid(dx,"1",zz-"1")&"&quot;"&mid(dx,zz+"1",ln) ; goto putlp3:
::sp="1":
putlp4:::
::zz=instr(dx,"<",sp):
::ln=len(dx){"";sp=zz+"1":
:zz ne "0":dx=mid(dx,"1",zz-"1")&"&lt;"&mid(dx,zz+"1",ln) ; goto putlp4:
::sp="1":
putlp5:::
::zz=instr(dx,">",sp):
::ln=len(dx){"";sp=zz+"1":
:zz ne "0":dx=mid(dx,"1",zz-"1")&"&gt;"&mid(dx,zz+"1",ln) ; goto putlp5:

Bill



More information about the Filepro-list mailing list