|
| Register now to interact with over 11,000 members! Registered users have Posting Privileges, free access to Private Messaging, Email Notifications and more. |
|
|||||||
![]() |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Registered
Join Date: Aug 2009
Location: texas
Posts: 6
Reputation: 0
|
Writing a record to file; can't get a carriage return to produce separate record line
I am reading and updating records in a simple flat file. I am creating a string to hold the updated record. I write the record with a "\n" following the string. I have tried this on my stand alone server and it works. When I try it on Powweb's server it doesn't recognize the carriage return.
I decided to make a short script that reads the file, updates one record and write out the entire file again. It writes the records that were not changed correctly (one on each line) and the one I update does not have a carriage return. What am I missing? Thanks in advance! Here is the code: Code:
Last edited by IanS : 9-28-09 at 07:23 PM. Reason: Added code tags |
|
|
|
|
|
#2 |
|
Join Date: Feb 2002
Location: Sydney, Australia
Posts: 7,131
Reputation: 333
|
If you are outputting html you need to use "<br />\n"
__________________
I don't suffer from laziness, I enjoy every minute! Edit your php.ini here http://members.powweb.com/member/cgi...nt/PHPplus.bml |
|
|
|
|
|
#3 |
|
PowWeb Staff
Join Date: Nov 2008
Location: Burlington
Posts: 386
Reputation: 122
|
How are you viewing the file?
If its in web browser. Check and see what the mime type is listed as. If its a .txt file our server might serve it up saying its text/plain or maybe it will say text/html this might cause your web browser to treat the file differently when viewed. |
|
|
|
|
|
#4 |
|
Registered
Join Date: Aug 2009
Location: texas
Posts: 6
Reputation: 0
|
I am viewing the file with Notepad. The file extension is .fle. Thanks!
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
|