Mordax Praetorian Posted January 1, 2008 Share Posted January 1, 2008 Greetings I'm trying to code a set of php scripts that will take text from the staff at my website, turn them into finished webpages and put them on the site Thanks to the brilliant site and forums here I am very confident this will be successful There are still 2 things I need however The first is a form type that can take large bodies of text seperated by newlines, and output it to php, something like this box i'm typing in now would be great The second is clarification on how the new line strings (/n etc) are used The pages I'm modifying were written originaly in Windows Notepad, which should mean they are using /r/n as a newline string, does this mean that when I read the contents of a file into a php string that any line breaks will appear as strings of /r/n which I can search for (to replace with <P> and <BR>)? Also, does this mean that any instances of /r/n I add in to the finished and fully modified file will become line breaks in Notepad (for me to modify later) and be totaly ignored by any web browsers reading the html file? Of the staff members working on my site, I am the only one with any knowledge of programming, and while I am new to php I do have a lot of experiance with other languages, so feel free to spam non-php specific technical terms at me, but keep in mind that the system I create in the end has to be usable by people with no comprehension of how programming works at all, I can't simply ask them to punctuate their writing with "<BR>" whenever they want a new line for example Thankyou in advance Quote Link to comment https://forums.phpfreaks.com/topic/83932-solved-large-bodies-of-text-and-end-of-line-strings/ Share on other sites More sharing options...
PHP_PhREEEk Posted January 1, 2008 Share Posted January 1, 2008 The Form type to hold what you want is a simple enough HTML textarea form. You can define the screen size of it via columns/rows. I'm sure you can google HTML textarea and figure that out... = ) The receiving script that processes the form can convert the new lines to '<br>' automatically using the nl2br() function. PhREEEk Quote Link to comment https://forums.phpfreaks.com/topic/83932-solved-large-bodies-of-text-and-end-of-line-strings/#findComment-427190 Share on other sites More sharing options...
Mordax Praetorian Posted January 1, 2008 Author Share Posted January 1, 2008 Great, I really wish I had looked into php sooner Ok, what about adding line breaks to a file? It isn't totaly necessary, but it would be very useful to open one of the pages in notepad later and for it to be easily readable there Quote Link to comment https://forums.phpfreaks.com/topic/83932-solved-large-bodies-of-text-and-end-of-line-strings/#findComment-427247 Share on other sites More sharing options...
PHP_PhREEEk Posted January 1, 2008 Share Posted January 1, 2008 When I copy text from a web page and paste into Notepad, I get the line breaks just fine... When typing into a textarea, the same behavior exists by where if I copy/paste to Notepad, those line breaks transfer as well. So, you may be thinking too far ahead... = ) Try some experimenting with your form, and if something starts not behaving as expected, post and we'll figure it out! PhREEEk Quote Link to comment https://forums.phpfreaks.com/topic/83932-solved-large-bodies-of-text-and-end-of-line-strings/#findComment-427262 Share on other sites More sharing options...
Mordax Praetorian Posted January 1, 2008 Author Share Posted January 1, 2008 Ok, thaks again for the help Quote Link to comment https://forums.phpfreaks.com/topic/83932-solved-large-bodies-of-text-and-end-of-line-strings/#findComment-427433 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.