Jump to content

Not Recognizing carriage return


 Share

This topic is 6415 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I am new to this whole FX.php stuff. I have successfully connected to my filemaker server, the problem I am having now is that when I display the fields from filemaker using PHP it is not recognizing the carriage returns that were entered via the Filemaker interface. Any suggestions???

Link to comment
Share on other sites

Hi, Hellgie! Yes, actually I think it is a WEB problem of returns not showing up and not PHP, per se... but I think there is a php function that can convert your returns to <BR> for proper web display... I'm not positive, though. I do not use FX yet, but Garry Claridge mentioned in a recent post that FileMaker has the ability to specifiy formatting for a field when showing it on a web page using CDML, e.g. [FMP-field: yourfield, break] or [FMP-field: yourfield, raw]

Check to see if FX has an accomodation for specifying a field encoding/format.

--ST

Link to comment
Share on other sites

Hi,

I got a reply in another forum that said Filemaker uses 'n' as a carriage return, so I made a script in php that replaces n with <br>. However this is not working. Does anybody have any idea what filemaker uses as a carriage return?

Thanks,

Eric

Link to comment
Share on other sites

Internally Filemaker uses Returns. When data is exported Filemaker uses the Return as a record separator. It uses Line Feeds to replace Returns in text fields.

I have no experience with php so I can't help you there.

Link to comment
Share on other sites

Actually, I'm new to PHP but I was confused about that, too.. maybe I still am. The n (unix) or the r (mac) and the nr (both characters for Windows, I think?) for new lines are not output on web pages. The CARRIAGE RETURN, ENTER, LINEFEED, etc. are different and platform dependent. If you do something like..

echo ("howdy" . " " . "n" . "r" . "hello, world");

then all you'll get is "howdy hello, world" in a web browser... no new lines, no returns. I don't know what it is, but I think there's a PHP function to convert those to <BR> when shown. I don't know what FileMaker uses internally or if you can capture/filter them.

--ST

Link to comment
Share on other sites

Hi,

I figured out my problem, hopefully it will help others. It turns out that the n needs to be in double quotes when using the str_replace function. So for example here is how I would echo a field that I got from Filemaker with line breaks:

echo str_replace("n","<br>", $filemakerfield);

Hope this helps other people...

Eric

Link to comment
Share on other sites

  • 3 weeks later...

This topic is 6415 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.