Hellgie Posted June 10, 2004 Posted June 10, 2004 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???
Steve T. Posted June 10, 2004 Posted June 10, 2004 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
Hellgie Posted June 14, 2004 Author Posted June 14, 2004 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
RalphL Posted June 14, 2004 Posted June 14, 2004 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.
Steve T. Posted June 14, 2004 Posted June 14, 2004 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
Garry Claridge Posted June 15, 2004 Posted June 15, 2004 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
Hellgie Posted June 17, 2004 Author Posted June 17, 2004 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
Jim McNeely Posted July 6, 2004 Posted July 6, 2004 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
Recommended Posts
This topic is 7515 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 accountSign in
Already have an account? Sign in here.
Sign In Now