Re: Re: [PHP] text insertion
On 10 Aug 2011 at 22:07, Chris Stinemetz wrote: >> >> Use HTML 'pre' tags: >> >> >> > > I just tried that and that puts all the text on a single line. You could write the string into another textarea, which you could make readonly for this purpose. -- Cheers -- Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re: [PHP] text insertion
Tim Streater wrote: >On 10 Aug 2011 at 22:39, Daniel P. Brown >wrote: > >> On Wed, Aug 10, 2011 at 17:37, Chris Stinemetz > >> wrote: >>> No luck. Thanks. >> >>Per list rules, please don't top-post. >> >>If the situation you're describing is accurate and correct, then >> is indeed what you want. > >But can you put a inside a table cell? (I don't know that >you can't, but it seems an odd thing to do). > >-- >Cheers -- Tim > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php First thing that jumps out at me is that the tags are apparently ignored. This suggests one of those ridiculous reset.css files being used, which uses css to style every Danny element the same. If its set to override the whitespace setting in a tag then that could cause the issue you are seeing, as I've never known pre tags to fail like that. Thanks, Ash http://www.ashleysheridan.co.uk -- Sent from my Android phone with K-9 Mail. Please excuse my brevity. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re: [PHP] text insertion
On 10 Aug 2011 at 22:39, Daniel P. Brown wrote: > On Wed, Aug 10, 2011 at 17:37, Chris Stinemetz > wrote: >> No luck. Thanks. > >Per list rules, please don't top-post. > >If the situation you're describing is accurate and correct, then > is indeed what you want. But can you put a inside a table cell? (I don't know that you can't, but it seems an odd thing to do). -- Cheers -- Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] text insertion
On Wed, Aug 10, 2011 at 17:37, Chris Stinemetz wrote: > No luck. Thanks. Per list rules, please don't top-post. If the situation you're describing is accurate and correct, then is indeed what you want. -- Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting (866-) 725-4321 http://www.parasane.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] text insertion
No luck. Thanks. On Aug 10, 2011 4:17 PM, wrote: > > how about > > echo nl2br($your_content); > > > > > - Original Message - > From: Chris Stinemetz > Date: Wednesday, August 10, 2011 5:09 pm > Subject: Re: [PHP] text insertion > To: "Daniel P. Brown" > Cc: Ashley Sheridan , PHP General < php-general@lists.php.net> > > > > > > >Use HTML 'pre' tags: > > > > > > > > > > > > > I just tried that and that puts all the text on a single line. > > > > > > echo ' > > ' . $posts_row['first_name'] > > . ' ' . > > $posts_row['last_name'] . ' ' . date('m-d-Y h:iA', > > strtotime($posts_row['store_date'])) . ' > > > > > > Broad Band test results: > > ' . > > $posts_row['store_tptest'] . '' > > .$posts_row['store_comments'] . ' > > '; > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] text insertion
how about echo nl2br($your_content); - Original Message - From: Chris Stinemetz Date: Wednesday, August 10, 2011 5:09 pm Subject: Re: [PHP] text insertion To: "Daniel P. Brown" Cc: Ashley Sheridan , PHP General > > > >Use HTML 'pre' tags: > > > > > > > > I just tried that and that puts all the text on a single line. > > > echo ' > ' . $posts_row['first_name'] > . ' ' . > $posts_row['last_name'] . ' ' . date('m-d-Y h:iA', > strtotime($posts_row['store_date'])) . ' > > > Broad Band test results: > ' . > $posts_row['store_tptest'] . '' > .$posts_row['store_comments'] . ' > '; > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
Re: [PHP] text insertion
> > Use HTML 'pre' tags: > > > I just tried that and that puts all the text on a single line. echo ' ' . $posts_row['first_name'] . ' ' . $posts_row['last_name'] . ' ' . date('m-d-Y h:iA', strtotime($posts_row['store_date'])) . ' Broad Band test results: ' . $posts_row['store_tptest'] . '' .$posts_row['store_comments'] . ' '; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] text insertion
:On Wed, Aug 10, 2011 at 16:02, Chris Stinemetz wrote: >> Are you sure its not preserved? When you output text in a browser, by >> default its output as html, not plain text. Html ignores extraneous >> whitespace, and doesn't use a monospaced font, so formatting text into >> columns in a textarea won't work either. Look at the html source code to see >> what is actually being output. > > Thanks Ashley > > Source is showing indentation and new paragaraphs just as I inserted > the text. How can I get HTML output to show same format? Use HTML 'pre' tags: -- Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting (866-) 725-4321 http://www.parasane.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] text insertion
You could try using markdown too. Sent from my iPhone On Aug 10, 2011, at 3:57 PM, Ashley Sheridan wrote: > > > Chris Stinemetz wrote: > >> How do I preserve text formatting when text is inserted into a database >> table? >> >> For example: I am using a textarea to allow users to leave comments >> into the database and I am using: >> >> '" . mysql_real_escape_string($_POST['store_comments']) . "',to >> prevent SQL injection; >> >> But when I call the data with php from the database the format it was >> inserted is not preserved. Is there a way to make sure when a user >> adds new paragraphs or indentation it will be preserved? >> >> Thank you, >> >> Chris >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php > > Are you sure its not preserved? When you output text in a browser, by default > its output as html, not plain text. Html ignores extraneous whitespace, and > doesn't use a monospaced font, so formatting text into columns in a textarea > won't work either. Look at the html source code to see what is actually being > output. > > Thanks, > Ash > http://www.ashleysheridan.co.uk > -- > Sent from my Android phone with K-9 Mail. Please excuse my brevity. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] text insertion
> Are you sure its not preserved? When you output text in a browser, by default > its output as html, not plain text. Html ignores extraneous whitespace, and > doesn't use a monospaced font, so formatting text into columns in a textarea > won't work either. Look at the html source code to see what is actually being > output. Thanks Ashley Source is showing indentation and new paragaraphs just as I inserted the text. How can I get HTML output to show same format? Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] text insertion
Chris Stinemetz wrote: >How do I preserve text formatting when text is inserted into a database >table? > >For example: I am using a textarea to allow users to leave comments >into the database and I am using: > >'" . mysql_real_escape_string($_POST['store_comments']) . "', to >prevent SQL injection; > >But when I call the data with php from the database the format it was >inserted is not preserved. Is there a way to make sure when a user >adds new paragraphs or indentation it will be preserved? > >Thank you, > >Chris > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php Are you sure its not preserved? When you output text in a browser, by default its output as html, not plain text. Html ignores extraneous whitespace, and doesn't use a monospaced font, so formatting text into columns in a textarea won't work either. Look at the html source code to see what is actually being output. Thanks, Ash http://www.ashleysheridan.co.uk -- Sent from my Android phone with K-9 Mail. Please excuse my brevity. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php