Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Not Recognizing carriage return

Featured Replies

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???

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

  • Author

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

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.

It's a ASCII 11, Vertical Tab.

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

You may have to use the tag "[FMP-Field: myfield, break]". Then replace "<br>" with whatever you need. I don't know how to do it with FX.

Another method to look at is the "nl2br()" php function. You could use it like:

echo nl2br($myfield);

Good Luck.

Garry

  • Author

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

  • 3 weeks later...

Use a cascading style sheet, or set an inline style like this:

<span style="whitespace:pre;">your text with lots of returns</span>

Then it will preserve your whitespace, including returns, multiple spaces, etc.

HTH

Jim McNeely

New Century Data

[email protected]

http://www.newcenturydata.com

(940)383-2772

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.