Little Goat Posted May 5, 2006 Share Posted May 5, 2006 Hi, I have a script I wrote to log information about people when they come to my site. it writes these logs to a file. I have tried making a new line with \n and \n\r and when I open the text file with both methods, it just shows a little box instead of a new line. how would I fix this?LGEdit: also, do you think it would be better to use SQL, or just a text file? I have to access the files later so a file might have advantages. Link to comment Share on other sites More sharing options...
Nakor Posted May 5, 2006 Share Posted May 5, 2006 A file might have it's advantages if you want to think of it that way, however, you could put them all into an SQL database and then create a script to display your logs in a more appealing way. It just depends on what you want. Link to comment Share on other sites More sharing options...
Little Goat Posted May 5, 2006 Author Share Posted May 5, 2006 yea maybe I should do that. but still I'd like to get the first problem sorted out... Link to comment Share on other sites More sharing options...
Jack McKalling Posted May 5, 2006 Share Posted May 5, 2006 You wrote \n\r instead of \r\n.Carrage return MUST come before newline Link to comment Share on other sites More sharing options...
Little Goat Posted May 5, 2006 Author Share Posted May 5, 2006 yep that was it.thank you sooo much!LG Link to comment Share on other sites More sharing options...
Jack McKalling Posted May 5, 2006 Share Posted May 5, 2006 Always remember, it is only neccesary to use "\n" for kladblok texts, but both "\r\n" for any other texteditors that have special fonts, colors and other layouts installed (like MS Word or just Wordpad)While \r\n works for both plain text and not-plain text, \n only works for plain text. Link to comment Share on other sites More sharing options...
Little Goat Posted May 6, 2006 Author Share Posted May 6, 2006 ok, thanks. i'll remember that.LG Link to comment Share on other sites More sharing options...
SFB Posted May 6, 2006 Share Posted May 6, 2006 A file might have it's advantages if you want to think of it that way, however, you could put them all into an SQL database and then create a script to display your logs in a more appealing way. It just depends on what you want.<{POST_SNAPBACK}> you could also write a script to disply your log in a more appealing way when your data is in a txt file as well. Link to comment Share on other sites More sharing options...
Little Goat Posted May 6, 2006 Author Share Posted May 6, 2006 I think I'll stick with the text, cause I don't really know SQL (just copy and paste off of w3schools) and I tried it and had problems.LG Link to comment Share on other sites More sharing options...
Jack McKalling Posted May 6, 2006 Share Posted May 6, 2006 Just in case you want to try something new, let this be a comfort: SQL is not difficult to learn :) Link to comment Share on other sites More sharing options...
Little Goat Posted May 6, 2006 Author Share Posted May 6, 2006 yea, I went a little into it, but I don't think I'll try it until I'm ready to take some time on it LG Link to comment Share on other sites More sharing options...
Recommended Posts
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