Re: [PHP] Textarea to road a text file
Yes, I just want to edit a file in the textarea! thank you. Jay Blanchard jblanch...@pocket.com wrote in message news:31454d514ff9a949b1fdfe294d5d1d80080...@ygex01wal.onecall.local... [snip] htmlheadtitle. body.. ?php $handle = fopen(./menu.php, r); $contents = ; if ($handle) { while (!feof($handle)) { $buffer = fgets($handle); $contents = $contents . $buffer; } fclose($handle); } echo textarea cols=80 rows=30 . $contents . /textarea; ? /body /html [/snip] Try http://us3.php.net/manual/en/function.file-get-contents.php ?php $contents = file_get_contents('./menu.php'); echo textarea cols=80 rows=30 . $contents . /textarea; ? I am unsure what you want to do here, display the menu in the textarea? Or do you want to be able to edit menu.php in the textarea? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Textarea to road a text file
Jean Lee wrote: Could you explain what was my fault concerned about this case? ?php $handle = fopen(./menu.php, r); $contents = ; if ($handle) { while (!feof($handle)) { $buffer = fgets($handle); $contents = $contents . $buffer; } fclose($handle); } echo textarea cols=80 rows=30 . $contents . /textarea; ? As Andrew pointed out, you need to use htmlspecialchars() echo textarea cols=80 rows=30 .htmlspecialchars($contents). /textarea; The reason for that is because the text may contain html control characters like ' which the browser will attempt to interpret. http://php.net/htmlspecialchars I usually use htmlentities() instead http://de.php.net/manual/en/function.htmlentities.php -- John Those willing to give up a little liberty for a little security deserve neither security nor liberty. [Benjamin Franklin] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Textarea to road a text file
[snip] htmlheadtitle. body.. ?php $handle = fopen(./menu.php, r); $contents = ; if ($handle) { while (!feof($handle)) { $buffer = fgets($handle); $contents = $contents . $buffer; } fclose($handle); } echo textarea cols=80 rows=30 . $contents . /textarea; ? /body /html [/snip] Try http://us3.php.net/manual/en/function.file-get-contents.php ?php $contents = file_get_contents('./menu.php'); echo textarea cols=80 rows=30 . $contents . /textarea; ? I am unsure what you want to do here, display the menu in the textarea? Or do you want to be able to edit menu.php in the textarea? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Textarea to road a text file
[snip]I want to use Textarea as the text-file viewer and editor of my homepage. But Textarea doesn't work exactly as i intended. In sometimes, TextArea doesn't show up and moreover the some parts of the file are displayed(rendered) in browser without TextArea![/snip] Not enough information to complete yourrequest? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Textarea to road a text file
On Wed, Oct 28, 2009 at 10:39 AM, Jean Lee versus...@ymail.com wrote: I want to use Textarea as the text-file viewer and editor of my homepage. But Textarea doesn't work exactly as i intended. In sometimes, TextArea doesn't show up and moreover the some parts of the file are displayed(rendered) in browser without TextArea! It sounds like you are not escaping the value that appears inside the textarea tags. textarea name=mytextarea?php echo htmlspecialchars($text_content); ?/textarea Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Textarea to road a text file
Thank you, Jay Blanchard and Andrew Ballard!!! Could you explain what was my fault concerned about this case? Thanks in advance! My codes were htmlheadtitle. body.. ?php $handle = fopen(./menu.php, r); $contents = ; if ($handle) { while (!feof($handle)) { $buffer = fgets($handle); $contents = $contents . $buffer; } fclose($handle); } echo textarea cols=80 rows=30 . $contents . /textarea; ? /body /html Jay Blanchard jblanch...@pocket.com wrote in message news:31454d514ff9a949b1fdfe294d5d1d80080...@ygex01wal.onecall.local... [snip]I want to use Textarea as the text-file viewer and editor of my homepage. But Textarea doesn't work exactly as i intended. In sometimes, TextArea doesn't show up and moreover the some parts of the file are displayed(rendered) in browser without TextArea![/snip] Not enough information to complete yourrequest? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
On Fri, 2009-05-15 at 07:03 -0700, PHPScriptor wrote: Hello, How do you guys handle this problem. Just a form with a textarea. When I use enters in the textarea it's saved to the db like this: database: first line second line when I edit the value in the form: first line second line when I output the value to html: first linesecond line (unless I use nl2br()) Is there a way that I could save it to the db that will work for db, output and edit without using any other function like nl2br? Not to the DB, but it should respect newlines if you wrap it in pre/pre tags. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
2009/5/15 PHPScriptor cont...@phpscriptor.com: Hello, How do you guys handle this problem. Just a form with a textarea. When I use enters in the textarea it's saved to the db like this: database: first line second line when I edit the value in the form: first line second line when I output the value to html: first linesecond line (unless I use nl2br()) Is there a way that I could save it to the db that will work for db, output and edit without using any other function like nl2br? What's your problem with using nl2br? This is the reason it exists!! Store the raw data in the database, and run nl2br on it when you display it. I don't see a problem. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
Well, instead of storing the text from the textarea directly into the db, validate it and wrap it with br / tags (replace \n) and then store it. This way you needn't use nl2br every time you retrieve the text from db. -Sterex On Fri, May 15, 2009 at 7:42 PM, Stuart stut...@gmail.com wrote: 2009/5/15 PHPScriptor cont...@phpscriptor.com: Hello, How do you guys handle this problem. Just a form with a textarea. When I use enters in the textarea it's saved to the db like this: database: first line second line when I edit the value in the form: first line second line when I output the value to html: first linesecond line (unless I use nl2br()) Is there a way that I could save it to the db that will work for db, output and edit without using any other function like nl2br? What's your problem with using nl2br? This is the reason it exists!! Store the raw data in the database, and run nl2br on it when you display it. I don't see a problem. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
Mja, that's not my intention, in that case I also could use nl2br... Why does this problem exists? And why does it work with pre? Is this a PHP problem or more a HTML problem? Robert Cummings wrote: On Fri, 2009-05-15 at 07:03 -0700, PHPScriptor wrote: Hello, How do you guys handle this problem. Just a form with a textarea. When I use enters in the textarea it's saved to the db like this: database: first line second line when I edit the value in the form: first line second line when I output the value to html: first linesecond line (unless I use nl2br()) Is there a way that I could save it to the db that will work for db, output and edit without using any other function like nl2br? Not to the DB, but it should respect newlines if you wrap it in pre/pre tags. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php - visit my website at http://www.phpscriptor.com/ http://www.phpscriptor.com/ -- View this message in context: http://www.nabble.com/textarea-new-line-to-mysql-database-tp23560478p23560765.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
Well, the problem is that I have a lot of forms, a lot of data to output, and even then, I don't know always where I have a textarea or just a inputfield. But true, I could even set the nl2br on an input field, it wouldn't make a difference. But I just don't understand why this problem exists? What's the reason? Stuart-47 wrote: 2009/5/15 PHPScriptor cont...@phpscriptor.com: Hello, How do you guys handle this problem. Just a form with a textarea. When I use enters in the textarea it's saved to the db like this: database: first line second line when I edit the value in the form: first line second line when I output the value to html: first linesecond line (unless I use nl2br()) Is there a way that I could save it to the db that will work for db, output and edit without using any other function like nl2br? What's your problem with using nl2br? This is the reason it exists!! Store the raw data in the database, and run nl2br on it when you display it. I don't see a problem. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php - visit my website at http://www.phpscriptor.com/ http://www.phpscriptor.com/ -- View this message in context: http://www.nabble.com/textarea-new-line-to-mysql-database-tp23560478p23560853.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
Yes, I thought about that. But then you have a problem when you're going to 'edit' that data back in a form. Then you get first linebr /second line in your textarea. Manoj Sterex wrote: Well, instead of storing the text from the textarea directly into the db, validate it and wrap it with br / tags (replace \n) and then store it. This way you needn't use nl2br every time you retrieve the text from db. -Sterex On Fri, May 15, 2009 at 7:42 PM, Stuart stut...@gmail.com wrote: 2009/5/15 PHPScriptor cont...@phpscriptor.com: Hello, How do you guys handle this problem. Just a form with a textarea. When I use enters in the textarea it's saved to the db like this: database: first line second line when I edit the value in the form: first line second line when I output the value to html: first linesecond line (unless I use nl2br()) Is there a way that I could save it to the db that will work for db, output and edit without using any other function like nl2br? What's your problem with using nl2br? This is the reason it exists!! Store the raw data in the database, and run nl2br on it when you display it. I don't see a problem. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php - visit my website at http://www.phpscriptor.com/ http://www.phpscriptor.com/ -- View this message in context: http://www.nabble.com/textarea-new-line-to-mysql-database-tp23560478p23560882.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
On Fri, 2009-05-15 at 19:48 +0530, Manoj Sterex wrote: Well, instead of storing the text from the textarea directly into the db, validate it and wrap it with br / tags (replace \n) and then store it. This way you needn't use nl2br every time you retrieve the text from db. Don't do that unless it's a cached entry in the DB. Unless you absolutely know you'll never need the raw text again, you should always store the raw text so it can be processed in the future in any way you see fit. If you want to speed up the process of conversion, use an additional field in the database, or a cache, that contains the processed content. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
On Fri, May 15, 2009 at 07:03:49AM -0700, PHPScriptor wrote: Hello, How do you guys handle this problem. Just a form with a textarea. When I use enters in the textarea it's saved to the db like this: database: first line second line when I edit the value in the form: first line second line when I output the value to html: first linesecond line (unless I use nl2br()) Is there a way that I could save it to the db that will work for db, output and edit without using any other function like nl2br? If I understand your question, the answer is no. If you have wrap=hard as an attribute for your textarea, it will store the data with CR/LF. But CR/LF don't show up as a line ending when displayed in HTML. You have to use nl2br() to translate for HTML. It also may be that you need to do a translation from CR/LF (textarea line ending) to LF (*nix line ending). The CR/LF *will* show up properly when *editing* in the textarea field, just not when displayed without a textarea. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
Well, its not exactly a 'problem' at all. The textarea just does what its meant to do - accept raw text input and lets you process it via form action. This is neither a PHP or a HTML 'problem'. The reason you cannot see the line breaks when you echo the text on your browser is the fact that the browser does not recognize '\n' as a line break; it only recognizes 'br /'. Coming to the pre tag, pre stands for preformatted; it tells the browser to output the text in the raw format as it is. Hence it displays properly. -Sterex On Fri, May 15, 2009 at 7:54 PM, PHPScriptor cont...@phpscriptor.comwrote: Yes, I thought about that. But then you have a problem when you're going to 'edit' that data back in a form. Then you get first linebr /second line in your textarea. Manoj Sterex wrote: Well, instead of storing the text from the textarea directly into the db, validate it and wrap it with br / tags (replace \n) and then store it. This way you needn't use nl2br every time you retrieve the text from db. -Sterex On Fri, May 15, 2009 at 7:42 PM, Stuart stut...@gmail.com wrote: 2009/5/15 PHPScriptor cont...@phpscriptor.com: Hello, How do you guys handle this problem. Just a form with a textarea. When I use enters in the textarea it's saved to the db like this: database: first line second line when I edit the value in the form: first line second line when I output the value to html: first linesecond line (unless I use nl2br()) Is there a way that I could save it to the db that will work for db, output and edit without using any other function like nl2br? What's your problem with using nl2br? This is the reason it exists!! Store the raw data in the database, and run nl2br on it when you display it. I don't see a problem. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php - visit my website at http://www.phpscriptor.com/ http://www.phpscriptor.com/ -- View this message in context: http://www.nabble.com/textarea-new-line-to-mysql-database-tp23560478p23560882.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
@Robert: True. I was assuming that the text was going to be final and not being edited again. @PHPScriptor: If you do have a lot of textareas to work around with, why don't you give TinyMCE a try. Thats the best option you have got. It replaces the textarea into more of a html compatible one and when you are editing the text again, it will be properly formatted. You'll also get toolbars for text editing etc., more like your mail compose window right now. :) -Sterex On Fri, May 15, 2009 at 7:56 PM, Robert Cummings rob...@interjinn.comwrote: On Fri, 2009-05-15 at 19:48 +0530, Manoj Sterex wrote: Well, instead of storing the text from the textarea directly into the db, validate it and wrap it with br / tags (replace \n) and then store it. This way you needn't use nl2br every time you retrieve the text from db. Don't do that unless it's a cached entry in the DB. Unless you absolutely know you'll never need the raw text again, you should always store the raw text so it can be processed in the future in any way you see fit. If you want to speed up the process of conversion, use an additional field in the database, or a cache, that contains the processed content. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
TinyMCE: http://tinymce.moxiecode.com/ -Sterex On Fri, May 15, 2009 at 7:56 PM, Paul M Foster pa...@quillandmouse.comwrote: On Fri, May 15, 2009 at 07:03:49AM -0700, PHPScriptor wrote: Hello, How do you guys handle this problem. Just a form with a textarea. When I use enters in the textarea it's saved to the db like this: database: first line second line when I edit the value in the form: first line second line when I output the value to html: first linesecond line (unless I use nl2br()) Is there a way that I could save it to the db that will work for db, output and edit without using any other function like nl2br? If I understand your question, the answer is no. If you have wrap=hard as an attribute for your textarea, it will store the data with CR/LF. But CR/LF don't show up as a line ending when displayed in HTML. You have to use nl2br() to translate for HTML. It also may be that you need to do a translation from CR/LF (textarea line ending) to LF (*nix line ending). The CR/LF *will* show up properly when *editing* in the textarea field, just not when displayed without a textarea. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
2009/5/15 PHPScriptor cont...@phpscriptor.com: Well, the problem is that I have a lot of forms, a lot of data to output, and even then, I don't know always where I have a textarea or just a inputfield. But true, I could even set the nl2br on an input field, it wouldn't make a difference. But I just don't understand why this problem exists? What's the reason? Trust me when I say in the grand scheme of things a call to nl2br is extremely cheap so I really wouldn't worry about how much you use it. If you don't know whether you're using a input field or a textarea I really think you need to examine your code carefully before proceeding. If you know to spit out a textarea then you know it's a textarea. Or maybe I'm missing something. The reason this problem exists is due to HTML compressing concurrent white space into a single space. This can be a very useful feature but is not immediately obvious to newcomers. If you're not familiar with HTML I suggest you put PHP down for a while and have a play with pure HTML - it'll be time well-invested. -Stuart -- http://stut.net/ Stuart-47 wrote: 2009/5/15 PHPScriptor cont...@phpscriptor.com: Hello, How do you guys handle this problem. Just a form with a textarea. When I use enters in the textarea it's saved to the db like this: database: first line second line when I edit the value in the form: first line second line when I output the value to html: first linesecond line (unless I use nl2br()) Is there a way that I could save it to the db that will work for db, output and edit without using any other function like nl2br? What's your problem with using nl2br? This is the reason it exists!! Store the raw data in the database, and run nl2br on it when you display it. I don't see a problem. -Stuart -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php - visit my website at http://www.phpscriptor.com/ http://www.phpscriptor.com/ -- View this message in context: http://www.nabble.com/textarea-new-line-to-mysql-database-tp23560478p23560853.html Sent from the PHP - General mailing list archive at Nabble.com. -- 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] textarea new line to mysql database
At 7:22 AM -0700 5/15/09, PHPScriptor wrote: Well, the problem is that I have a lot of forms, a lot of data to output, and even then, I don't know always where I have a textarea or just a inputfield. But true, I could even set the nl2br on an input field, it wouldn't make a difference. But I just don't understand why this problem exists? What's the reason? Simply, the problem deals with how different systems handle the end of line (EOL) character? You can read more about it here: http://en.wikipedia.org/wiki/Newline What you've encountered (IMO) is just another extension/example of the problem. Now, your choices are to: 1. Listen to Rob (the wisest) and use the pre tag. 2. Listen to Stuart (the wisest) and use the nl2br() function 3. Listen to Sterex (IMO -- who is totally wrong) and put html in your database; 4. Or, listen to me (who is somewhere between Rob/Stuart and Sterex) and use either the pre tag or the nlbr() function depending upon what you want to do with the output. Both solutions [1 and 2] provide different ways to handle data. Number [3] simply creates another problem you, or someone else, will have to deal with later on. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
@tedd: Its just another way of looking at the things. Putting HTML into the DB is not really wrong (perhaps in this context it is). If you do have HTML in the DB, you can directly echo it out and use CSS to style it accordingly. Just my 2 cents. :) -Sterex On Fri, May 15, 2009 at 8:24 PM, tedd tedd.sperl...@gmail.com wrote: At 7:22 AM -0700 5/15/09, PHPScriptor wrote: Well, the problem is that I have a lot of forms, a lot of data to output, and even then, I don't know always where I have a textarea or just a inputfield. But true, I could even set the nl2br on an input field, it wouldn't make a difference. But I just don't understand why this problem exists? What's the reason? Simply, the problem deals with how different systems handle the end of line (EOL) character? You can read more about it here: http://en.wikipedia.org/wiki/Newline What you've encountered (IMO) is just another extension/example of the problem. Now, your choices are to: 1. Listen to Rob (the wisest) and use the pre tag. 2. Listen to Stuart (the wisest) and use the nl2br() function 3. Listen to Sterex (IMO -- who is totally wrong) and put html in your database; 4. Or, listen to me (who is somewhere between Rob/Stuart and Sterex) and use either the pre tag or the nlbr() function depending upon what you want to do with the output. Both solutions [1 and 2] provide different ways to handle data. Number [3] simply creates another problem you, or someone else, will have to deal with later on. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
On Fri, 2009-05-15 at 10:54 -0400, tedd wrote: At 7:22 AM -0700 5/15/09, PHPScriptor wrote: Well, the problem is that I have a lot of forms, a lot of data to output, and even then, I don't know always where I have a textarea or just a inputfield. But true, I could even set the nl2br on an input field, it wouldn't make a difference. But I just don't understand why this problem exists? What's the reason? Simply, the problem deals with how different systems handle the end of line (EOL) character? You can read more about it here: http://en.wikipedia.org/wiki/Newline What you've encountered (IMO) is just another extension/example of the problem. Now, your choices are to: 1. Listen to Rob (the wisest) and use the pre tag. 2. Listen to Stuart (the wisest) and use the nl2br() function 3. Listen to Sterex (IMO -- who is totally wrong) and put html in your database; 4. Or, listen to me (who is somewhere between Rob/Stuart and Sterex) and use either the pre tag or the nlbr() function depending upon what you want to do with the output. Both solutions [1 and 2] provide different ways to handle data. Number [3] simply creates another problem you, or someone else, will have to deal with later on. Actually, after reading the other posts with respect to what he's trying to do, I would use nl2br() unless I specifically needed pre/pre. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
On Fri, May 15, 2009 at 07:19:24AM -0700, PHPScriptor wrote: Mja, that's not my intention, in that case I also could use nl2br... Why does this problem exists? And why does it work with pre? Is this a PHP problem or more a HTML problem? HTML doesn't recognize newlines when it displays text. The pre tag maintains the formatting of your original text, including newlines. Unfortunately, it also displays text in a monospace font. Paul -- Paul M. Foster -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
On Fri, 2009-05-15 at 11:29 -0400, Paul M Foster wrote: On Fri, May 15, 2009 at 07:19:24AM -0700, PHPScriptor wrote: Mja, that's not my intention, in that case I also could use nl2br... Why does this problem exists? And why does it work with pre? Is this a PHP problem or more a HTML problem? HTML doesn't recognize newlines when it displays text. The pre tag maintains the formatting of your original text, including newlines. Unfortunately, it also displays text in a monospace font. You can style a pre tag. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
At 8:38 PM +0530 5/15/09, Manoj Sterex wrote: @tedd: Its just another way of looking at the things. Putting HTML into the DB is not really wrong (perhaps in this context it is). If you do have HTML in the DB, you can directly echo it out and use CSS to style it accordingly. Just my 2 cents. :) -Sterex Thanks for taking my comment without flaming. What I said was based upon having to deal with clients who mix html and all sorts of stuff in their database and then wonder why certain pages look funny. They can't seem to grasp the concept of paired tags. To them b means to make this section bold and quit somewhere it looks best. It's been an experience and that has left me with the opinion that civilians should stay the hell out of the programming -- just tell us what they want and not how to do it. Pardon my slant on things. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
At 11:29 AM -0400 5/15/09, Paul M Foster wrote: On Fri, May 15, 2009 at 07:19:24AM -0700, PHPScriptor wrote: Mja, that's not my intention, in that case I also could use nl2br... Why does this problem exists? And why does it work with pre? Is this a PHP problem or more a HTML problem? HTML doesn't recognize newlines when it displays text. The pre tag maintains the formatting of your original text, including newlines. Unfortunately, it also displays text in a monospace font. Paul I believe that you can override that with css. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
PHPScriptor wrote: Hello, How do you guys handle this problem. Just a form with a textarea. When I use enters in the textarea it's saved to the db like this: database: first line second line when I edit the value in the form: first line second line when I output the value to html: first linesecond line (unless I use nl2br()) Is there a way that I could save it to the db that will work for db, output and edit without using any other function like nl2br? I run all text area through a filter that removes the carriage return [ preg_replace('/\r/','',$input) ] and save it in the database with any newline characters. When calling data from the database, I can then use newline as a delimiter for explode generate an array where each element of the array is a distinct line of text - and then do whatever I want with the lines. Effectively what I usually do is the same thing as nl2br - but since I do everything in DOMDocument I have to do it myself (create text nodes for each array element and create break nodes between them). If I'm going to a pre field or back to a text area (IE to edit the data) then I don't have to do anything. I do NOT recommend running nl2br before it goes into the database - as that means you may have to convert the breaks when re-using the data elsewhere, and the proper way to make a break depends upon the output type (IE br for html or br / for xhtml, etc.) - so keep the newline character in the database and convert to what you need when you call the data from the database. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
At 11:19 AM -0400 5/15/09, Robert Cummings wrote: On Fri, 2009-05-15 at 10:54 -0400, tedd wrote: 4. Or, listen to me (who is somewhere between Rob/Stuart and Sterex) and use either the pre tag or the nlbr() function depending upon what you want to do with the output. Both solutions [1 and 2] provide different ways to handle data. Number [3] simply creates another problem you, or someone else, will have to deal with later on. Actually, after reading the other posts with respect to what he's trying to do, I would use nl2br() unless I specifically needed pre/pre. Cheers, Rob. -- That would be my first choice as well. However, one can style a pre tag whereas it's very difficult (if not impossible) to style what goes in between br / tags. Also, one can generate validation errors using br / because there are three different varieties of the tag, namely br, br /, and br/ -- all of which can be used in different settings. I don't remember which doctypes go with which version (xhtml requires /), but I've run into that problem before. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
tedd wrote: Also, one can generate validation errors using br / because there are three different varieties of the tag, namely br, br /, and br/ -- all of which can be used in different settings. I don't remember which doctypes go with which version (xhtml requires /), but I've run into that problem before. That's where DOMDocument helps - saveHTML() produces valid html break, saveXML() produces valid xhtml break, all from the same DOMDocument object. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
On 5/15/09 10:12 AM, Stuart stut...@gmail.com wrote: What's your problem with using nl2br? it's not multibyte safe. if you're using mb strings, e.g. for utf8 pages and forms, then use preg_replace (with the u modifier) instead of ml2br -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line to mysql database
At 2:10 PM -0400 5/15/09, Tom Worster wrote: On 5/15/09 10:12 AM, Stuart stut...@gmail.com wrote: What's your problem with using nl2br? it's not multibyte safe. if you're using mb strings, e.g. for utf8 pages and forms, then use preg_replace (with the u modifier) instead of ml2br Whoa -- and I thought you were just another pretty face. Good point. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea html generation problem
I prefer the htmlentities because it allows me to edit the real code, not an edited form of the code. All the still appear. On Tue, Sep 16, 2008 at 9:41 AM, TQ White II [EMAIL PROTECTED] wrote: I add str_replace('textarea', 'textareaHIDE', ... to the display code and the reverse to the store it away code. Good luck. tqii On Sep 15, 2008, at 8:08 PM, sean greenslade wrote: Hi all! I am trying to make a PHP HTML editor. I have made the entire editor function, but it has a big problem. If the page contains a /textarea tag, it ends the editor's textarea and the browser starts rendering the HTML. How do I go about preventing this from happening? Thanks a lot! --Zootboy TQ White II • 708-763-0100 Website • JustKidding.com http://justkidding.com/ -- Feh.
Re: [PHP] textarea html generation problem
On Tue, 2008-09-16 at 17:15 +0930, Michael Kubler wrote: I've just been playing with FCKeditor, it seem pretty good. Good documentation and I could get it working fairly quickly, although I haven't got it picking up the style sheet from a secondary domain yet, but that's probably a PEBKAC on my part. Michael Kubler *G*rey *P*hoenix *P*roductions http://www.greyphoenix.biz Ashley Sheridan wrote: Whats wrong with trying one of the major ones in use at the moment, like FCKEditor? Ash www.ashleysheridan.co.uk It's just unfortunate that the guys initials happened to be what they were... More than one client has raised an eyebrow when they saw FCKEditor... Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea html generation problem
Thanks to all for your responses. I ended up using htmlentities. Thanks Stephen. Also, the reason I didn't use a premade editor is that I am planning on selling a web-editor system and don't want any troubles with licenses. quote Hi all! I am trying to make a PHP HTML editor. I have made the entire editor function, but it has a big problem. If the page contains a /textarea tag, it ends the editor's textarea and the browser starts rendering the HTML. How do I go about preventing this from happening? Thanks a lot! --Zootboy /quote
Re: [PHP] Textarea update problem
[EMAIL PROTECTED] wrote: is there a question here, or are you asking us to write the script for you? - Rick Original Message Date: Wednesday, March 07, 2007 01:54:04 PM +0100 From: Delta Storm [EMAIL PROTECTED] To: php-general@lists.php.net Subject: [PHP] Textarea update problem Hi, I'd like to thank everybody who have helped me till now. All your advices were very helpfull... :) But I have a problem again I need to build a script which will have have the following functions: 1.Be able to select 3 columns from a MySQL database(idnetify the columns by ID) and put the column contents into 3 textarea objects. (for example title,Text1,Text2 each into i textarea). 2.Edit and MySQL update the textarea contents And all in one script. The script has a $id = $_GET['id'] variable which holds the information about the certain table id. -- End Original Message -- This is the script, I have dealt with both problems but when I click on the update button (submit button) i get an error msg: Access forbidden! You don't have permission to access the requested object. It is either read-protected or not readable by the server. If you think this is a server error, please contact the webmaster mailto:[EMAIL PROTECTED]. Error 403 localhost / 03/07/07 16:17:37 Apache/2.2.3 (Win32) DAV/2 mod_ssl/2.2.3 OpenSSL/0.9.8d mod_autoindex_color PHP/5.2.0 The user name and pass for the MySQL server are 100% correct. It reads out the data from the database into the textarea object but when I click the update button I get that msg. Thank you! :) !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; lang=hr head meta http-equiv=Content-Type content=text/html; charset=utf-8 meta http-equiv=Content-Language content=hr titleUPDATE news and article items/title link rel=stylesheet type=text/css href=style.css / /head body ?php $id = $_GET['id']; include(authenticate.php); $link = mysql_connect(localhost,$admin,$pass) or die (Could not connect to database); mysql_select_db(europe) or die (Could not select database); mysql_query(set names utf8); $selResult = mysql_query(select title,sText,fText from news where id='$id'); if (mysql_num_rows($selResult) 0) { while ($row = mysql_fetch_array($selResult)) { if (!$_POST[submit]) { echo 'table border=0 cellspacing=0 cellpadding=0 align=center'; echo tr; echo 'td colspan=2'; echo form action='?php echo $_SERVER[PHP_SELF] ?' method=post; echo input type=text size=180 name=title value= . $row['title'] .; echo /td; echo /tr; echo tr; echo td; echo h2sText/h2; echo 'textarea cols=65 rows=30 name=sText'; echo $row['sText']; echo /textarea; echo '/td td h2fText/h2 textarea cols=65 rows=30 name=fText '; echo $row['fText']; echo '/textarea /td /tr tr td colspan=2 align=center input type=submit value=UPDATE name=submit /form /td /tr /table'; } else { $title = ($_POST['title']); $sText = ($_POST['sText']); $fText = ($_POST['fText']); $query = update news set title='$title', sText='$sText', fText='$fText' where id='$id'; $result = mysql_query($query) or die (could not process query : $query . mysql_error()); if ($result) { echo Data updated succesfully; echo 'a href=edititems.phpPovratak na editiranje/a'; } else { echo Data update FAILED; } mysql_close($link); } } } ? /body /html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Textarea update problem
The file permissions are not set right, Apache is not able to read the PHP file you've just uploaded to your server, chmod it to 644. That should fix it. Tijnema On 3/7/07, Delta Storm [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: is there a question here, or are you asking us to write the script for you? - Rick Original Message Date: Wednesday, March 07, 2007 01:54:04 PM +0100 From: Delta Storm [EMAIL PROTECTED] To: php-general@lists.php.net Subject: [PHP] Textarea update problem Hi, I'd like to thank everybody who have helped me till now. All your advices were very helpfull... :) But I have a problem again I need to build a script which will have have the following functions: 1.Be able to select 3 columns from a MySQL database(idnetify the columns by ID) and put the column contents into 3 textarea objects. (for example title,Text1,Text2 each into i textarea). 2.Edit and MySQL update the textarea contents And all in one script. The script has a $id = $_GET['id'] variable which holds the information about the certain table id. -- End Original Message -- This is the script, I have dealt with both problems but when I click on the update button (submit button) i get an error msg: Access forbidden! You don't have permission to access the requested object. It is either read-protected or not readable by the server. If you think this is a server error, please contact the webmaster mailto:[EMAIL PROTECTED]. Error 403 localhost / 03/07/07 16:17:37 Apache/2.2.3 (Win32) DAV/2 mod_ssl/2.2.3 OpenSSL/0.9.8d mod_autoindex_color PHP/5.2.0 The user name and pass for the MySQL server are 100% correct. It reads out the data from the database into the textarea object but when I click the update button I get that msg. Thank you! :) !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; lang=hr head meta http-equiv=Content-Type content=text/html; charset=utf-8 meta http-equiv=Content-Language content=hr titleUPDATE news and article items/title link rel=stylesheet type=text/css href=style.css / /head body ?php $id = $_GET['id']; include(authenticate.php); $link = mysql_connect(localhost,$admin,$pass) or die (Could not connect to database); mysql_select_db(europe) or die (Could not select database); mysql_query(set names utf8); $selResult = mysql_query(select title,sText,fText from news where id='$id'); if (mysql_num_rows($selResult) 0) { while ($row = mysql_fetch_array($selResult)) { if (!$_POST[submit]) { echo 'table border=0 cellspacing=0 cellpadding=0 align=center'; echo tr; echo 'td colspan=2'; echo form action='?php echo $_SERVER[PHP_SELF] ?' method=post; echo input type=text size=180 name=title value= . $row['title'] .; echo /td; echo /tr; echo tr; echo td; echo h2sText/h2; echo 'textarea cols=65 rows=30 name=sText'; echo $row['sText']; echo /textarea; echo '/td td h2fText/h2 textarea cols=65 rows=30 name=fText '; echo $row['fText']; echo '/textarea /td /tr tr td colspan=2 align=center input type=submit value=UPDATE name=submit /form /td /tr /table'; } else { $title = ($_POST['title']); $sText = ($_POST['sText']); $fText = ($_POST['fText']); $query = update news set title='$title', sText='$sText', fText='$fText' where id='$id'; $result = mysql_query($query) or die (could not process query : $query . mysql_error()); if ($result) { echo Data updated succesfully; echo 'a href=edititems.phpPovratak na editiranje/a'; } else { echo Data update FAILED; } mysql_close($link); } } } ? /body /html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Textarea update problem
2007. 03. 7, szerda keltezéssel 16.28-kor Delta Storm ezt írta: [EMAIL PROTECTED] wrote: is there a question here, or are you asking us to write the script for you? - Rick Original Message Date: Wednesday, March 07, 2007 01:54:04 PM +0100 From: Delta Storm [EMAIL PROTECTED] To: php-general@lists.php.net Subject: [PHP] Textarea update problem Hi, I'd like to thank everybody who have helped me till now. All your advices were very helpfull... :) But I have a problem again I need to build a script which will have have the following functions: 1.Be able to select 3 columns from a MySQL database(idnetify the columns by ID) and put the column contents into 3 textarea objects. (for example title,Text1,Text2 each into i textarea). 2.Edit and MySQL update the textarea contents And all in one script. The script has a $id = $_GET['id'] variable which holds the information about the certain table id. -- End Original Message -- This is the script, I have dealt with both problems but when I click on the update button (submit button) i get an error msg: Access forbidden! You don't have permission to access the requested object. It is either read-protected or not readable by the server. If you think this is a server error, please contact the webmaster mailto:[EMAIL PROTECTED]. Error 403 localhost / 03/07/07 16:17:37 Apache/2.2.3 (Win32) DAV/2 mod_ssl/2.2.3 OpenSSL/0.9.8d mod_autoindex_color PHP/5.2.0 The user name and pass for the MySQL server are 100% correct. It reads out the data from the database into the textarea object but when I click the update button I get that msg. Thank you! :) !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; lang=hr head meta http-equiv=Content-Type content=text/html; charset=utf-8 meta http-equiv=Content-Language content=hr titleUPDATE news and article items/title link rel=stylesheet type=text/css href=style.css / /head body ?php $id = $_GET['id']; include(authenticate.php); $link = mysql_connect(localhost,$admin,$pass) or die (Could not connect to database); mysql_select_db(europe) or die (Could not select database); mysql_query(set names utf8); $selResult = mysql_query(select title,sText,fText from news where id='$id'); if (mysql_num_rows($selResult) 0) { while ($row = mysql_fetch_array($selResult)) { you don't need that if above, as the while loop will not start at all if there is no rows in the result if (!$_POST[submit]) { echo 'table border=0 cellspacing=0 cellpadding=0 align=center'; echo tr; echo 'td colspan=2'; echo form action='?php echo $_SERVER[PHP_SELF] ?' method=post; echo input type=text size=180 name=title value= . $row['title'] .; echo /td; echo /tr; echo tr; echo td; echo h2sText/h2; echo 'textarea cols=65 rows=30 name=sText'; echo $row['sText']; echo /textarea; echo '/td td h2fText/h2 textarea cols=65 rows=30 name=fText '; echo $row['fText']; echo '/textarea /td /tr tr td colspan=2 align=center input type=submit value=UPDATE name=submit /form /td /tr /table'; } else { $title = ($_POST['title']); $sText = ($_POST['sText']); $fText = ($_POST['fText']); why are you putting those $_POST values in brackets? it should be $title = $_POST['title']; btw, you should check those values before passing them to the database because of security reasons $query = update news set title='$title', sText='$sText', fText='$fText' where id='$id'; $result = mysql_query($query) or die (could not process query : $query . mysql_error()); here you don't need $result I think, you could just use mysql_query($query) or die (could not process query : $query . mysql_error()); if ($result) { and you don't have to check for $result, as the die statement would cause your script to stop executing if there was an error, so if it gets here you might just print out everything is ok echo Data updated succesfully; echo
Re: [PHP] Textarea update problem
Delta Storm wrote: [EMAIL PROTECTED] wrote: is there a question here, or are you asking us to write the script for you? - Rick Original Message Date: Wednesday, March 07, 2007 01:54:04 PM +0100 From: Delta Storm [EMAIL PROTECTED] To: php-general@lists.php.net Subject: [PHP] Textarea update problem Hi, I'd like to thank everybody who have helped me till now. All your advices were very helpfull... :) But I have a problem again I need to build a script which will have have the following functions: 1.Be able to select 3 columns from a MySQL database(idnetify the columns by ID) and put the column contents into 3 textarea objects. (for example title,Text1,Text2 each into i textarea). 2.Edit and MySQL update the textarea contents And all in one script. The script has a $id = $_GET['id'] variable which holds the information about the certain table id. -- End Original Message -- This is the script, I have dealt with both problems but when I click on the update button (submit button) i get an error msg: Access forbidden! You don't have permission to access the requested object. It is either read-protected or not readable by the server. If you think this is a server error, please contact the webmaster mailto:[EMAIL PROTECTED]. Error 403 localhost / 03/07/07 16:17:37 Apache/2.2.3 (Win32) DAV/2 mod_ssl/2.2.3 OpenSSL/0.9.8d mod_autoindex_color PHP/5.2.0 The user name and pass for the MySQL server are 100% correct. It reads out the data from the database into the textarea object but when I click the update button I get that msg. Thank you! :) !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; lang=hr head meta http-equiv=Content-Type content=text/html; charset=utf-8 meta http-equiv=Content-Language content=hr titleUPDATE news and article items/title link rel=stylesheet type=text/css href=style.css / /head body ?php $id = $_GET['id']; include(authenticate.php); $link = mysql_connect(localhost,$admin,$pass) or die (Could not connect to database); mysql_select_db(europe) or die (Could not select database); mysql_query(set names utf8); $selResult = mysql_query(select title,sText,fText from news where id='$id'); if (mysql_num_rows($selResult) 0) { while ($row = mysql_fetch_array($selResult)) { if (!$_POST[submit]) { echo 'table border=0 cellspacing=0 cellpadding=0 align=center'; echo tr; echo 'td colspan=2'; You can't do this You are inside a php echo statement already. Then you are trying to break into php from html echo form action='?php echo $_SERVER[PHP_SELF] ?' method=post; Not sure what error level you are set to but you should have quotes around PHP_SELF I see it everywhere else, maybe you missed this one. ie: $_SERVER['PHP_SELF']; Previous line should read: echo form action='{$_SERVER['PHP_SELF']}' method=post; echo input type=text size=180 name=title value= . $row['title'] .; echo /td; echo /tr; echo tr; echo td; echo h2sText/h2; echo 'textarea cols=65 rows=30 name=sText'; echo $row['sText']; echo /textarea; echo '/td td h2fText/h2 textarea cols=65 rows=30 name=fText '; echo $row['fText']; echo '/textarea /td /tr tr td colspan=2 align=center input type=submit value=UPDATE name=submit /form /td /tr /table'; } else { $title = ($_POST['title']); $sText = ($_POST['sText']); $fText = ($_POST['fText']); $query = update news set title='$title', sText='$sText', fText='$fText' where id='$id'; $result = mysql_query($query) or die (could not process query : $query . mysql_error()); if ($result) { echo Data updated succesfully; echo 'a href=edititems.phpPovratak na editiranje/a'; } else { echo Data update FAILED; } mysql_close($link); } } } ? /body /html -- Enjoy, Jim Lucas Different eyes see different things. Different hearts beat on different strings. But there are times for you and me when all such things agree. - Rush -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] textarea posting duplicate text
Thanks, Dan. I copied your code exactly and posted it here: http://www.tidefans.com/test.php I pasted a large part of O'Henry's Gift of the Magi into the textarea, and it gets repeated, as before. Thanks for any help, Elizabeth -Original Message- From: Dan Tappin [mailto:[EMAIL PROTECTED] Sent: Monday, February 28, 2005 6:59 PM To: Elizabeth Lawrence Subject: Re: [PHP] textarea posting duplicate text Create a new file: test.php with this exactly in the contents: HTML HEAD TITLETEST/TITLE /HEAD BODY FORM ACTION=test.php METHOD=post NAME=test TEXTAREA NAME=textarea ROWS=4 COLS=40/TEXTAREA PINPUT TYPE=submit NAME=submitButtonName/P /FORM P? print_r($_REQUEST); ?/P /BODY /HTML Load the page, enter some text and hit submit. Rule out some strange issue with your page. Confirm it's a PHP issue not a coding one. Dan T On Feb 28, 2005, at 8:03 AM, Elizabeth Lawrence wrote: Hello. I have been asked to look at a PHP issue for someone, and I can't figure out what the problem is. I'm hoping one of you experts can help! They are using Red Hat Linux / Ensim Pro 4.0.2, PHP 4.3.10, and Apache 2.0. The problem: When a lot of text is entered into a textarea on a form, the text that shows up in the $_POST['textarea'] variable has the text that was entered, but it is duplicated. This is causing problems for their forums. Here is a very simple script I placed on the server: www.tidefans.com/textarea_test.php (code below) When I place the same script on another server I have access to, the textarea text is posted fine. Is this a PHP setting somewhere that I'm missing? Here is the code for the PHP script mentioned above: html head titleTest PHP Script/title /head body form method=post action=textarea_test.php name=Form1 textarea cols=50 rows=20 name=textarea //[a bunch of text goes here] /textareabr input type=text name=text size=20 value=This is some textbr input type=submit name=Submit value=Submit ?php if ($_POST[Submit] != ) { echo h1_POST values/h1; echo pTextarea submitted:/p; echo pre . $_POST[textarea] . /pre; echo pTextbox submitted:/p; echo pre . $_POST[text] . /pre; echo pSubmit submitted:/p; echo pre . $_POST[Submit] . /pre; } ? /form ?php phpinfo(); ? /body /html If anyone can point me in the right direction, I would appreciate it so much! Elizabeth Elizabeth Lawrence [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] textarea posting duplicate text
On Tue, 2005-03-01 at 08:43, Elizabeth Lawrence wrote: Thanks, Dan. I copied your code exactly and posted it here: http://www.tidefans.com/test.php I pasted a large part of O'Henry's Gift of the Magi into the textarea, and it gets repeated, as before. Thanks for any help, Elizabeth There are some settings in php.ini that affect the max size of post variables. It is sort of interesting to me that it is not a complete copy but the first 1303 bytes or so are printed and then the test as a whole is there preceded by testarea=. It does not do this on my server. 4.3.6 apache 2 I notice that the Server API says Apache 2.0 Filter on your box and on mine it says Apache 2.0 Handler. I have no idea what that means. Bret -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] textarea posting duplicate text
On Tue, 2005-03-01 at 10:19, Bret Hughes wrote: On Tue, 2005-03-01 at 08:43, Elizabeth Lawrence wrote: Thanks, Dan. I copied your code exactly and posted it here: http://www.tidefans.com/test.php I pasted a large part of O'Henry's Gift of the Magi into the textarea, and it gets repeated, as before. Thanks for any help, Elizabeth There are some settings in php.ini that affect the max size of post variables. It is sort of interesting to me that it is not a complete copy but the first 1303 bytes or so are printed and then the test as a whole is there preceded by testarea=. It does not do this on my server. 4.3.6 apache 2 I notice that the Server API says Apache 2.0 Filter on your box and on mine it says Apache 2.0 Handler. I have no idea what that means. Bret Hmm I did not remember writing the bit about post_max_size. I was checking your settings in the phpinfo output when I found the filter/handler deal. obviously the post_max_size is not the culprit. Bret -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea posting duplicate text
It's definitely on your end: http://www.orourke.ca/test.php I verified your issue on your server and could not reproduce it on mine. Our phpinfo data looks the same. Here's a hunch. Try calling output buffering at the top of your page: ob_start(); I have this on my site to allow for mid-page redirects. I have no idea if this is the cause. Just an idea. Perhaps an Apache 2 issue? Can any one else confirm this on Apache 2 / PHP 4.3.10? Dan T On Mar 1, 2005, at 7:43 AM, Elizabeth Lawrence wrote: Thanks, Dan. I copied your code exactly and posted it here: http://www.tidefans.com/test.php I pasted a large part of O'Henry's Gift of the Magi into the textarea, and it gets repeated, as before. Thanks for any help, Elizabeth -Original Message- From: Dan Tappin [mailto:[EMAIL PROTECTED] Sent: Monday, February 28, 2005 6:59 PM To: Elizabeth Lawrence Subject: Re: [PHP] textarea posting duplicate text Create a new file: test.php with this exactly in the contents: HTML HEAD TITLETEST/TITLE /HEAD BODY FORM ACTION=test.php METHOD=post NAME=test TEXTAREA NAME=textarea ROWS=4 COLS=40/TEXTAREA PINPUT TYPE=submit NAME=submitButtonName/P /FORM P? print_r($_REQUEST); ?/P /BODY /HTML Load the page, enter some text and hit submit. Rule out some strange issue with your page. Confirm it's a PHP issue not a coding one. Dan T On Feb 28, 2005, at 8:03 AM, Elizabeth Lawrence wrote: Hello. I have been asked to look at a PHP issue for someone, and I can't figure out what the problem is. I'm hoping one of you experts can help! They are using Red Hat Linux / Ensim Pro 4.0.2, PHP 4.3.10, and Apache 2.0. The problem: When a lot of text is entered into a textarea on a form, the text that shows up in the $_POST['textarea'] variable has the text that was entered, but it is duplicated. This is causing problems for their forums. Here is a very simple script I placed on the server: www.tidefans.com/textarea_test.php (code below) When I place the same script on another server I have access to, the textarea text is posted fine. Is this a PHP setting somewhere that I'm missing? Here is the code for the PHP script mentioned above: html head titleTest PHP Script/title /head body form method=post action=textarea_test.php name=Form1 textarea cols=50 rows=20 name=textarea //[a bunch of text goes here] /textareabr input type=text name=text size=20 value=This is some textbr input type=submit name=Submit value=Submit ?php if ($_POST[Submit] != ) { echo h1_POST values/h1; echo pTextarea submitted:/p; echo pre . $_POST[textarea] . /pre; echo pTextbox submitted:/p; echo pre . $_POST[text] . /pre; echo pSubmit submitted:/p; echo pre . $_POST[Submit] . /pre; } ? /form ?php phpinfo(); ? /body /html If anyone can point me in the right direction, I would appreciate it so much! Elizabeth Elizabeth Lawrence [EMAIL PROTECTED] -- 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] textarea posting duplicate text
Elizabeth Lawrence wrote: Thanks, Dan. I copied your code exactly and posted it here: http://www.tidefans.com/test.php I pasted a large part of O'Henry's Gift of the Magi into the textarea, and it gets repeated, as before. There was an Apache2/PHP bug going around that had this issue. It was an older version of PHP and/or Apache2 that I thought was fixed, though. Maybe your running into this same issue? Try searching the PHP bug database for apache2 duplicate and see if you can find the old bug/issue. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea posting duplicate text
Elizabeth! Have you considered reinstalling PHP on your server? Maybe, it is worth the effort? Regards, Frank 2005-03-01 kl. 17.19 skrev Bret Hughes: On Tue, 2005-03-01 at 08:43, Elizabeth Lawrence wrote: Thanks, Dan. I copied your code exactly and posted it here: http://www.tidefans.com/test.php I pasted a large part of O'Henry's Gift of the Magi into the textarea, and it gets repeated, as before. Thanks for any help, Elizabeth There are some settings in php.ini that affect the max size of post variables. It is sort of interesting to me that it is not a complete copy but the first 1303 bytes or so are printed and then the test as a whole is there preceded by testarea=. It does not do this on my server. 4.3.6 apache 2 I notice that the Server API says Apache 2.0 Filter on your box and on mine it says Apache 2.0 Handler. I have no idea what that means. Bret -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Frank Arensmeier Marketing Support NIKE HYDRAULICS AB Box 1107 631 80 Eskilstuna Sweden tel +46 16 82 34 fax +46 16 13 93 16 email: [EMAIL PROTECTED] www.nikehydraulics.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea posting duplicate text
Elizabeth Lawrence wrote: Hello. I have been asked to look at a PHP issue for someone, and I can't figure out what the problem is. I'm hoping one of you experts can help! They are using Red Hat Linux / Ensim Pro 4.0.2, PHP 4.3.10, and Apache 2.0. The problem: When a lot of text is entered into a textarea on a form, the text that shows up in the $_POST['textarea'] variable has the text that was entered, but it is duplicated. Have you verified that the POST data itself is doubled?... This sounds REALLY weird to me... This is causing problems for their forums. Here is a very simple script I placed on the server: www.tidefans.com/textarea_test.php (code below) When I place the same script on another server I have access to, the textarea text is posted fine. Is this a PHP setting somewhere that I'm missing? There's certainly on double long POST data setting :-) It could be a bug in PHP or Apache -- Search their bug databases. http://bugs.php.net/ for PHP. http://apache.org/ should lead you to it for Apache. You're on your own for Ensim Pro, whatever that is. I would also recommend that you start LOGGING the text inputs that are giving problems as they come in. EG: ?php $input = $_POST['input']; $len = strlen($input); if ($len 10 substr($input, 0, $len/2) == substr($input, $len/2)){ error_log(Double Input: $input); } ? This may lead you to finding some commonality in the input text other than length that is not immediately apparent right now. Actually, I guess you *COULD* just use the code above or similar to automatically strip out the doubled text -- But document/comment the hell out of that unless you want to confuse every developer that ever looks at it!!! -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Textarea and Php
Ross, Try something like this in your form: textarea name=description rows=4 cols=40$description/textarea You can then edit the contents of the cell Hope this helps. Hugh - Original Message - From: Ross Hulford [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Tuesday, January 18, 2005 12:15 AM Subject: [PHP] Textarea and Php Is there a way to add and remove lines of text to a textarea inside a form? Thanks Ross -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.6.13 - Release Date: 1/16/2005 -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.6.13 - Release Date: 1/16/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Textarea and Php
Ross Hulford wrote: Is there a way to add and remove lines of text to a textarea inside a form? Presumably you mean based on user input like clicking on buttons and things. By that point in time, PHP on the *server* is LONG GONE and not even in the picture. You'll have to use JavaScript. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] textarea vs. type=text data difference?
Just wanted to point out something little. text types are all single-line data items. textarea can contain line breaks. Looks like you may have solved your problem already, but wanted to fill in some info that didn't seem to be mentioned. -TG -Original Message- From: Sam Smith [mailto:[EMAIL PROTECTED] Sent: Sunday, October 10, 2004 3:29 PM To: PHP Subject: [PHP] textarea vs. type=text data difference? I have a form with both textarea and text type fields. I submit it and do some processing on identical data and get different results. What's up with that. Thank you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea vs. type=text data difference?
##The data is the same. I've been up a long time. BUT something is still very weird. Doc1.php (loaded in web browser) //contents of Doc1.php include functions.php include formProcessor.php include form.php Calling the protectText() function in functions.php from formProcessor.php with data posted from form.php works on data posted from textarea fields but does NOT on data posted from type=text. //contents of functions.php ONLY works on textarea fields The fundtion in function.php is: function protectText($tv) { $tv = stripslashes($tv); $tv = str_replace(\,[QT],$tv); $tv = str_replace(\r,br,$tv); return $tv; } BUT if I put the same function in formprocessor.php it works!?? //contents of formprocessor.php THIS works on both function TSTprotectText($tv) { $tv = stripslashes($tv); $tv = str_replace(\,[QT],$tv); $tv = str_replace(\r,br,$tv); return $tv; } TSTprotectText($_POST['field']); Now how can that be? Can you be a little more specific on what differences you get? I normally use textarea for multi-line data and input type=text for one line, short data... the only difference you might encounter that I can think off the top of my head is maybe line break? - Original Message - From: Sam Smith [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Sunday, October 10, 2004 3:28 PM Subject: [PHP] textarea vs. type=text data difference? I have a form with both textarea and text type fields. I submit it and do some processing on identical data and get different results. What's up with that. Thank you. -- 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] textarea vs. type=text data difference?
On Sun, 10 Oct 2004 12:28:53 -0700, Sam Smith [EMAIL PROTECTED] wrote: I have a form with both textarea and text type fields. I submit it and do some processing on identical data and get different results. What's up with that. No idea since you didn't post any code. -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea vs. type=text data difference?
Okay, so in other words... //Doc1.php include functions.php //this file contains the function definition for protectText() include formProcessor.php //this file contains the code that calls protectText() include form.php //this file gets the form data from user By any chance, are ANY of the include files classes? I'm not 100% sure(unless you put up some more code), but it sounds like it's maybe a scope error... especially if you define the function in formProcessor and it works fine... -Minuk - Original Message - From: Sam Smith [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Sunday, October 10, 2004 4:25 PM Subject: Re: [PHP] textarea vs. type=text data difference? ##The data is the same. I've been up a long time. BUT something is still very weird. Doc1.php (loaded in web browser) //contents of Doc1.php include functions.php include formProcessor.php include form.php Calling the protectText() function in functions.php from formProcessor.php with data posted from form.php works on data posted from textarea fields but does NOT on data posted from type=text. //contents of functions.php ONLY works on textarea fields The fundtion in function.php is: function protectText($tv) { $tv = stripslashes($tv); $tv = str_replace(\,[QT],$tv); $tv = str_replace(\r,br,$tv); return $tv; } BUT if I put the same function in formprocessor.php it works!?? //contents of formprocessor.php THIS works on both function TSTprotectText($tv) { $tv = stripslashes($tv); $tv = str_replace(\,[QT],$tv); $tv = str_replace(\r,br,$tv); return $tv; } TSTprotectText($_POST['field']); Now how can that be? Can you be a little more specific on what differences you get? I normally use textarea for multi-line data and input type=text for one line, short data... the only difference you might encounter that I can think off the top of my head is maybe line break? - Original Message - From: Sam Smith [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Sunday, October 10, 2004 3:28 PM Subject: [PHP] textarea vs. type=text data difference? I have a form with both textarea and text type fields. I submit it and do some processing on identical data and get different results. What's up with that. Thank you. -- 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea vs. type=text data difference?
htmlentities! Thanks a lot for taking the time but it was just my nubie error. What had me going all off in the wrong direction was textarea fields don't need htmlentities to display quotes correctly like a text field does. you know like this: value=some text with important info Displays in textarea fine but in type=text of course you get some text What a female dog. Okay, so in other words... //Doc1.php include functions.php //this file contains the function definition for protectText() include formProcessor.php //this file contains the code that calls protectText() include form.php //this file gets the form data from user By any chance, are ANY of the include files classes? I'm not 100% sure(unless you put up some more code), but it sounds like it's maybe a scope error... especially if you define the function in formProcessor and it works fine... -Minuk - Original Message - From: Sam Smith [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Sunday, October 10, 2004 4:25 PM Subject: Re: [PHP] textarea vs. type=text data difference? ##The data is the same. I've been up a long time. BUT something is still very weird. Doc1.php (loaded in web browser) //contents of Doc1.php include functions.php include formProcessor.php include form.php Calling the protectText() function in functions.php from formProcessor.php with data posted from form.php works on data posted from textarea fields but does NOT on data posted from type=text. //contents of functions.php ONLY works on textarea fields The fundtion in function.php is: function protectText($tv) { $tv = stripslashes($tv); $tv = str_replace(\,[QT],$tv); $tv = str_replace(\r,br,$tv); return $tv; } BUT if I put the same function in formprocessor.php it works!?? //contents of formprocessor.php THIS works on both function TSTprotectText($tv) { $tv = stripslashes($tv); $tv = str_replace(\,[QT],$tv); $tv = str_replace(\r,br,$tv); return $tv; } TSTprotectText($_POST['field']); Now how can that be? Can you be a little more specific on what differences you get? I normally use textarea for multi-line data and input type=text for one line, short data... the only difference you might encounter that I can think off the top of my head is maybe line break? - Original Message - From: Sam Smith [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Sunday, October 10, 2004 3:28 PM Subject: [PHP] textarea vs. type=text data difference? I have a form with both textarea and text type fields. I submit it and do some processing on identical data and get different results. What's up with that. Thank you. -- 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] textarea/display question...
Make sure to remove tags via: $var_that_will_be_displayed = strip_tags( $var_from_user_input_via_POST_or_GET_or_COOKIE ); if you are going to display or mail it as part of a link(email or URL), you might do this instead: $var_that_will_be_part_of_a_link = strip_tags( rawurldecode( $var_from_user_input_via_POST_or_GET_or_COOKIE ) ); See this page: http://www.cgisecurity.com/articles/xss-faq.shtml -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea/display question...
Dennis Gearon wrote: Make sure to remove tags via: $var_that_will_be_displayed = strip_tags( $var_from_user_input_via_POST_or_GET_or_COOKIE ); if you are going to display or mail it as part of a link(email or URL), you might do this instead: $var_that_will_be_part_of_a_link = strip_tags( rawurldecode( $var_from_user_input_via_POST_or_GET_or_COOKIE ) ); See this page: http://www.cgisecurity.com/articles/xss-faq.shtml Yeah, use strip_tags so you can get rid of evil, malicious content such as grin... gasp! Just use htmlentities() like others have already suggested, so you don't change the users input. There's nothing more annoying than programs that strip out content from what users write because they think it's bad. Using allowed_tags with strip_tags() just introduces the possibility for vulnerabilities since attributes aren't checked. Javascript in a b tag, you say? Yep... -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea/display question...
Anything inside that textarea actually get's displayed. So they will actually see that HTML. I don't know of a way to actually highlight sections within the text area, and I don't think there is one. You could highlight the text outside of the textarea though. Jon bruce wrote: hi.. i'm presenting a textarea to the user... i'd like to be able to display the information within the textarea in a table format. this would allow me to highlight the material that the user should modify. however, i can't figure out how to accomplish this... $foo = 'tabletrtd class='red'blah/td/tr/table'; textarea value='$foo'/textarea something like the above, but without displaying all the attrib stuff... any ideas/pointers would be appreciated.. thanks -bruce -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] textarea/display question...
Hi, With textarea, there is no value... textarea$foo/textarea -Dan Joseph $foo = 'tabletrtd class='red'blah/td/tr/table'; textarea value='$foo'/textarea -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] textarea/display question...
Have you considered an imbedded frame? (Looks like a textarea, with the ability to imbed all types of controls (and tables) within it). I'm not sure that all browsers support IFRAME yet, but the most widely used one does. Another approach would be to use sprinf() formatting to imbed leading/trailing spaces to allow everything to line up, assuming your text area uses a fixed pitch font like courier. Course since the control is an input control, trust your users are going to screw up the alignment, and don't count on getting the data back all neatly lined up. Warren Vail -Original Message- From: bruce [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 20, 2004 10:59 AM To: [EMAIL PROTECTED] Subject: [PHP] textarea/display question... hi.. i'm presenting a textarea to the user... i'd like to be able to display the information within the textarea in a table format. this would allow me to highlight the material that the user should modify. however, i can't figure out how to accomplish this... $foo = 'tabletrtd class='red'blah/td/tr/table'; textarea value='$foo'/textarea something like the above, but without displaying all the attrib stuff... any ideas/pointers would be appreciated.. thanks -bruce -- 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] textarea/display question...
I've always gotten errors when trying to use the value property of a textarea. Put the value info between the textarea/textarea tabs. -Original Message- From: bruce [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 20, 2004 12:59 PM To: [EMAIL PROTECTED] Subject: [PHP] textarea/display question... hi.. i'm presenting a textarea to the user... i'd like to be able to display the information within the textarea in a table format. this would allow me to highlight the material that the user should modify. however, i can't figure out how to accomplish this... $foo = 'tabletrtd class='red'blah/td/tr/table'; textarea value='$foo'/textarea something like the above, but without displaying all the attrib stuff... any ideas/pointers would be appreciated.. thanks -bruce -- 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] textarea/display question...
bruce wrote: textarea value='$foo'/textarea Please review your HTML textbook. There is no value attribute for a textarea. textarea$foo/textarea -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] textarea/display question...
vail... with an iframe... can i allow the user to make changes... and then capture the data as a value for a post within a form..??? in other words...does it closely give me what a textarea does with regards to allowing a user to make mods to the information? -thanks.. ps.. to you guys who said that the textarea doesn't have a value=''.. it does... -Original Message- From: Vail, Warren [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 20, 2004 11:20 AM To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] Subject: RE: [PHP] textarea/display question... Have you considered an imbedded frame? (Looks like a textarea, with the ability to imbed all types of controls (and tables) within it). I'm not sure that all browsers support IFRAME yet, but the most widely used one does. Another approach would be to use sprinf() formatting to imbed leading/trailing spaces to allow everything to line up, assuming your text area uses a fixed pitch font like courier. Course since the control is an input control, trust your users are going to screw up the alignment, and don't count on getting the data back all neatly lined up. Warren Vail -Original Message- From: bruce [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 20, 2004 10:59 AM To: [EMAIL PROTECTED] Subject: [PHP] textarea/display question... hi.. i'm presenting a textarea to the user... i'd like to be able to display the information within the textarea in a table format. this would allow me to highlight the material that the user should modify. however, i can't figure out how to accomplish this... $foo = 'tabletrtd class='red'blah/td/tr/table'; textarea value='$foo'/textarea something like the above, but without displaying all the attrib stuff... any ideas/pointers would be appreciated.. thanks -bruce -- 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea/display question...
On Tue, 20 Jul 2004 10:59:06 -0700, bruce [EMAIL PROTECTED] wrote: hi.. i'm presenting a textarea to the user... i'd like to be able to display the information within the textarea in a table format. this would allow me to highlight the material that the user should modify. however, i can't figure out how to accomplish this... $foo = 'tabletrtd class='red'blah/td/tr/table'; textarea value='$foo'/textarea something like the above, but without displaying all the attrib stuff... any ideas/pointers would be appreciated.. First of all, textareas don't have a value attribute, you put the text between the textarea tags. Second, you simply can't do that. Textareas are normal text only. However, there are JavaScript plugins you can use to do this: http://dynarch.com/mishoo/htmlarea.epl -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] textarea/display question...
Yes, but by nature, it must be a separate form. What appears in the IFRAME is like any other frame, an entire web page, and as a separate web page and separate form, it must have it's own submit button (within the form). Course you could cause some of the other controls on the form to trigger the submit, like changing a selection on a select list; select name=fmyselect onChange=this.form.submit(); option value='a'this is a/option /select Hope this helps, Warren Vail -Original Message- From: bruce [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 20, 2004 11:51 AM To: Vail, Warren; [EMAIL PROTECTED] Subject: RE: [PHP] textarea/display question... vail... with an iframe... can i allow the user to make changes... and then capture the data as a value for a post within a form..??? in other words...does it closely give me what a textarea does with regards to allowing a user to make mods to the information? -thanks.. ps.. to you guys who said that the textarea doesn't have a value=''.. it does... -Original Message- From: Vail, Warren [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 20, 2004 11:20 AM To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] Subject: RE: [PHP] textarea/display question... Have you considered an imbedded frame? (Looks like a textarea, with the ability to imbed all types of controls (and tables) within it). I'm not sure that all browsers support IFRAME yet, but the most widely used one does. Another approach would be to use sprinf() formatting to imbed leading/trailing spaces to allow everything to line up, assuming your text area uses a fixed pitch font like courier. Course since the control is an input control, trust your users are going to screw up the alignment, and don't count on getting the data back all neatly lined up. Warren Vail -Original Message- From: bruce [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 20, 2004 10:59 AM To: [EMAIL PROTECTED] Subject: [PHP] textarea/display question... hi.. i'm presenting a textarea to the user... i'd like to be able to display the information within the textarea in a table format. this would allow me to highlight the material that the user should modify. however, i can't figure out how to accomplish this... $foo = 'tabletrtd class='red'blah/td/tr/table'; textarea value='$foo'/textarea something like the above, but without displaying all the attrib stuff... any ideas/pointers would be appreciated.. thanks -bruce -- 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] textarea/display question...
That is a tough question to answer simply, but the basic answer is yes. What appears in the IFRAME is actually another web page, complete with it's own set of controls and it's own form, and something to trigger the submission of that form (separately from the page containing the IFRAME). Suppose your entire form consisted of a collection of text controls (one for each cell in your table); Assume you have your data in a 2 dimension array $darray. To display the array on a page; Echo table; For($row = 0; $row $height; $row++) { echo tr; for($col = 0; $col $width; $col++) { echo tdinput type=text name=\farray[.$row.][.$col.]\ .value=\.$darray[$row][$col].\/td\n; } echo /tr; } Echo /table; This would look much like a VB grid control, notice that a table by itself is not an input type control. This is just one solution, and so many are available. Notice that the form will return a multi-dimension array; $returnarray = $_GET[farray]; Hope this gets you started. Warren Vail -Original Message- From: bruce [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 20, 2004 11:51 AM To: Vail, Warren; [EMAIL PROTECTED] Subject: RE: [PHP] textarea/display question... vail... with an iframe... can i allow the user to make changes... and then capture the data as a value for a post within a form..??? in other words...does it closely give me what a textarea does with regards to allowing a user to make mods to the information? -thanks.. ps.. to you guys who said that the textarea doesn't have a value=''.. it does... -Original Message- From: Vail, Warren [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 20, 2004 11:20 AM To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] Subject: RE: [PHP] textarea/display question... Have you considered an imbedded frame? (Looks like a textarea, with the ability to imbed all types of controls (and tables) within it). I'm not sure that all browsers support IFRAME yet, but the most widely used one does. Another approach would be to use sprinf() formatting to imbed leading/trailing spaces to allow everything to line up, assuming your text area uses a fixed pitch font like courier. Course since the control is an input control, trust your users are going to screw up the alignment, and don't count on getting the data back all neatly lined up. Warren Vail -Original Message- From: bruce [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 20, 2004 10:59 AM To: [EMAIL PROTECTED] Subject: [PHP] textarea/display question... hi.. i'm presenting a textarea to the user... i'd like to be able to display the information within the textarea in a table format. this would allow me to highlight the material that the user should modify. however, i can't figure out how to accomplish this... $foo = 'tabletrtd class='red'blah/td/tr/table'; textarea value='$foo'/textarea something like the above, but without displaying all the attrib stuff... any ideas/pointers would be appreciated.. thanks -bruce -- 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea/display question...
ps.. to you guys who said that the textarea doesn't have a value=''.. it does... Where did you find this out? I was pretty sure that is did not have the value attribute. http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/textarea.asp http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.7 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] textarea/display question...
ps.. to you guys who said that the textarea doesn't have a value=''.. it does... Please, in this documentation from the W3C's site, show me where there's a value attribute for textarea. http://www.w3.org/TR/1998/REC-html40-19980424/interact/forms.html#h-17.7 --Matthew Sims --http://killermookie.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea/display question...
you can set designmode on a iframe to make it editable if you like, you can use javascript to use commands from the browser on the iframe even. And textarea may have a value attribute, however the element is meant to tag its displayed value from between the open and close tags. Jason On Tue, 20 Jul 2004 11:51:22 -0700, bruce [EMAIL PROTECTED] wrote: vail... with an iframe... can i allow the user to make changes... and then capture the data as a value for a post within a form..??? in other words...does it closely give me what a textarea does with regards to allowing a user to make mods to the information? -thanks.. ps.. to you guys who said that the textarea doesn't have a value=''.. it does... -Original Message- From: Vail, Warren [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 20, 2004 11:20 AM To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] Subject: RE: [PHP] textarea/display question... Have you considered an imbedded frame? (Looks like a textarea, with the ability to imbed all types of controls (and tables) within it). I'm not sure that all browsers support IFRAME yet, but the most widely used one does. Another approach would be to use sprinf() formatting to imbed leading/trailing spaces to allow everything to line up, assuming your text area uses a fixed pitch font like courier. Course since the control is an input control, trust your users are going to screw up the alignment, and don't count on getting the data back all neatly lined up. Warren Vail -Original Message- From: bruce [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 20, 2004 10:59 AM To: [EMAIL PROTECTED] Subject: [PHP] textarea/display question... hi.. i'm presenting a textarea to the user... i'd like to be able to display the information within the textarea in a table format. this would allow me to highlight the material that the user should modify. however, i can't figure out how to accomplish this... $foo = 'tabletrtd class='red'blah/td/tr/table'; textarea value='$foo'/textarea something like the above, but without displaying all the attrib stuff... any ideas/pointers would be appreciated.. thanks -bruce -- 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 -- 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] textarea/display question...
bruce wrote: ps.. to you guys who said that the textarea doesn't have a value=''.. it does... No, it doesn't. Pleae upgrade your textbooks. http://www.w3.org/TR/html4/interact/forms.html#h-17.7 -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea/display question...
On Tue, 20 Jul 2004 11:51:22 -0700, bruce [EMAIL PROTECTED] wrote: with an iframe... can i allow the user to make changes... and then capture the data as a value for a post within a form..??? in other words...does it closely give me what a textarea does with regards to allowing a user to make mods to the information? What you're looking for is a replace for textarea that supports HTML editing. Try http://www.interactivetools.com/products/htmlarea/ (IE only unfortunately - but there are others, try searching Google for edit html textarea or similar to find them). ps.. to you guys who said that the textarea doesn't have a value=''.. it does... Erm, no, it doesn't. -- Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] textarea/display question...
Stut wrote: On Tue, 20 Jul 2004 11:51:22 -0700, bruce [EMAIL PROTECTED] wrote: with an iframe... can i allow the user to make changes... and then capture the data as a value for a post within a form..??? in other words...does it closely give me what a textarea does with regards to allowing a user to make mods to the information? What you're looking for is a replace for textarea that supports HTML editing. Try http://www.interactivetools.com/products/htmlarea/ (IE only unfortunately - but there are others, try searching Google for edit html textarea or similar to find them). ps.. to you guys who said that the textarea doesn't have a value=''.. it does... Erm, no, it doesn't. -- Stut There is a newer version of the HTMLarea from Interactive Tools, and it is supported by IE 5.x, Mozilla, Firefox, etc. http://dynarch.com/mishoo/htmlarea.epl HTH. Pablo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea/display question...
bruce wrote: $foo = 'tabletrtd class='red'blah/td/tr/table'; textarea value='$foo'/textarea Everything but one thing has been said: You should always use htmlspecialchars() to output value of textarea $foo = 'tabletrtd class='red'blah/td/tr/table'; echo 'textarea ...' . htmlspecialchars($foo) . '/textarea'; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea and quotes
From: Vincent DUPONT [EMAIL PROTECTED] I can't remember the name of the function to remove the escaping of quotes when submitting a textarea example : tr class=content_title becomes : tr class=\content_title\ stripslashes and stripcslashes seem not to work... stripslashes() works, just make sure you capture the result. example: $newstr = stripslashes($oldstr); and not: stripslashes($oldstr); ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea rich replacement?
Just remove the appropriate buttons. Justin French wrote: Hi all, I've looked at both editize(.com) and HTMLArea, both of which are in-browser Rich Text editor replacements (written in java) for the standard textarea. Unfortunately, they both allow far too much control... at most I only want to offer H1, H2, P, B, A and I -- no colors, no images and please please please no tables :) Is anyone familiar with such a product? It doesn't have to be open source at all -- quite prepared to pay for something if it works. Regards, Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] TextArea vs. URLEncode/URLDecode/quotes
- Original Message - From: Arcadius A. [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 12:50 PM Subject: [PHP] TextArea vs. URLEncode/URLDecode/quotes (snip) So, My question is: What's the best way to get the value of a textarea back after validation without using session? Thanks. Arcadius Ahouansou. Try htmlspecialchars() or htmlentities() to convert quotes and other non-url friendly characters.. http://www.php.net/manual/en/function.htmlspecialchars.php http://www.php.net/manual/en/function.htmlentities.php - Kevin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] TextArea vs. URLEncode/URLDecode/quotes
The correct way is: In validate.php: if(error) { if(magic_quotes) stripslashes(); urlencode(); } else { INSERT INTO ... } In form.php: // urldecode() is not needed, GET variables are already decoded if(magic_quotes) stripslashes(); textarea?= htmlspecialchars()?/textarea Arcadius A. wrote: Hello! I have a form with a textarea... When the user submits the form, I validate the form on another page.. and in case the data are not valid, I redirect the user back to the form, passing all the info filled in previously in the URL, then I easily display the values in the form again For textarea, I use : urlencode($textarea_value) to pass the text in the URL for the validating page. And in the textarea, to get back the info, I do: textarea?=urldecode($_GET['textarea_value'])?/textarea This works fine as far as there is no quote in the text In case there are quotes in the text, quotes are escaped :-( so I get in the textarea slashes just before the quotes and stripslashes doesn't seem to help... So, My question is: What's the best way to get the value of a textarea back after validation without using session? Thanks. Arcadius Ahouansou. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] TextArea vs. URLEncode/URLDecode/quotes
Marek Kilimajer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] The correct way is: In validate.php: if(error) { if(magic_quotes) stripslashes(); urlencode(); } else { INSERT INTO ... } In form.php: // urldecode() is not needed, GET variables are already decoded if(magic_quotes) stripslashes(); textarea?= htmlspecialchars()?/textarea Thanks!!! :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea problem
At 14:34 23.01.2003, Denis L. Menezes said: [snip] ?php Print 'textarea name=OrgAddress cols=44 rows=5 id=textarea value='.htmlspecialchars($row['OrgName']).'/textarea'; ? [snip] This won't work. textarea needs its value outside the tag, without an attribute, just plain: Print 'textarea name=OrgAddress cols=44 rows=5 id=textarea', htmlspecialchars($row['OrgName']), '/textarea'; -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line
Sorry, you DO need nl's, but it's \n not n\ PHPCoder wrote: When you echo, you are adding to HTML, so you need br for new lines not \n. There is a function called nl2br that converts the nl into br's for you, so do this; $string=-line1n\ -line2 n\-line3; $string = nl2br($string); echo brtextarea name='aria' cols='50' rows='2'$string/textarea; adi wrote: i want to add in textarea a string with new line tag in it. how to do that? my try: $string=-line1n\ -line2 n\-line3; echo brtextarea name='aria' cols='50' rows='2'$string/textarea; but i see a single line instead of: -line1 -line2 -line3 tx in advance for any help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line
When you echo, you are adding to HTML, so you need br for new lines not \n. There is a function called nl2br that converts the nl into br's for you, so do this; $string=-line1n\ -line2 n\-line3; $string = nl2br($string); echo brtextarea name='aria' cols='50' rows='2'$string/textarea; adi wrote: i want to add in textarea a string with new line tag in it. how to do that? my try: $string=-line1n\ -line2 n\-line3; echo brtextarea name='aria' cols='50' rows='2'$string/textarea; but i see a single line instead of: -line1 -line2 -line3 tx in advance for any help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line+mysql update
tx, it's working now but i still have a problem: i want to insert into mysql database value $string: $result2 = db_query(update table1 set column1= '$string' where ID = '$IDcurent') or db_die(); When i try to view in text area the new value from column1, the newlines disappear! ps.column 1 have type text or varchar(100) Is a problem of type? tx again adi - Original Message - From: Henning Sittler [EMAIL PROTECTED] To: 'adi' [EMAIL PROTECTED] Sent: Friday, July 05, 2002 4:05 PM Subject: RE: [PHP] textarea new line $string=-line1\n -line2 \n-line3; \n Henning Sittler www.inscriber.com -Original Message- From: adi [mailto:[EMAIL PROTECTED]] Sent: Friday, July 05, 2002 9:04 AM To: php-general Subject: [PHP] textarea new line i want to add in textarea a string with new line tag in it. how to do that? my try: $string=-line1n\ -line2 n\-line3; echo brtextarea name='aria' cols='50' rows='2'$string/textarea; but i see a single line instead of: -line1 -line2 -line3 tx in advance for any help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea new line+mysql update
use addslashes update table1 set column1= '.addslashes($string).' where ID = '$IDcurent' Adi wrote: tx, it's working now but i still have a problem: i want to insert into mysql database value $string: $result2 = db_query(update table1 set column1= '$string' where ID = '$IDcurent') or db_die(); When i try to view in text area the new value from column1, the newlines disappear! ps.column 1 have type text or varchar(100) Is a problem of type? tx again adi - Original Message - From: Henning Sittler [EMAIL PROTECTED] To: 'adi' [EMAIL PROTECTED] Sent: Friday, July 05, 2002 4:05 PM Subject: RE: [PHP] textarea new line $string=-line1\n -line2 \n-line3; \n Henning Sittler www.inscriber.com -Original Message- From: adi [mailto:[EMAIL PROTECTED]] Sent: Friday, July 05, 2002 9:04 AM To: php-general Subject: [PHP] textarea new line i want to add in textarea a string with new line tag in it. how to do that? my try: $string=-line1n\ -line2 n\-line3; echo brtextarea name='aria' cols='50' rows='2'$string/textarea; but i see a single line instead of: -line1 -line2 -line3 tx in advance for any help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] textarea/textarea
stripslahses($variable) -Original Message- From: Vlad Kulchitski [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 14, 2002 9:26 AM To: [EMAIL PROTECTED] Subject: [PHP] textarea/textarea Hi, I have the following probably very simple problem. Basically what I need to do is to collect info from the user via 4 steps... like a set of input type(s) throughout STEP 1 of 4 ... STEP 4 of 4... etc... submitted to db on STEP 5. The only problem I have is I need to display textarea on step 3, and once again the same textarea on step 4 so that user has another chance to review what s/he's written in and on the fifth page all date submitted to db. The problem though is that it adds slashes, and on the submission page (page 5) there's like three slashes for the info collected via textarea. Basically, for instance I submit I'm Russian on step 3, by the time this data reached final step it's I\\\'m Russian. How can I overcome this issue? If I avoid putting variable taken from step 3 to 4th into textarea name=about_eng $about_eng/textarea and do input type=hidden name=about_eng value=about_eng half of the data gets lost, only first word from the submitted previously remains... Hope this was descriptive and hope someone can suggest something. Thanks, Vlad -- 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] textarea/textarea
I mean: stripslashes($variable) -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 14, 2002 9:24 AM To: 'Vlad Kulchitski'; [EMAIL PROTECTED] Subject: RE: [PHP] textarea/textarea stripslahses($variable) -Original Message- From: Vlad Kulchitski [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 14, 2002 9:26 AM To: [EMAIL PROTECTED] Subject: [PHP] textarea/textarea Hi, I have the following probably very simple problem. Basically what I need to do is to collect info from the user via 4 steps... like a set of input type(s) throughout STEP 1 of 4 ... STEP 4 of 4... etc... submitted to db on STEP 5. The only problem I have is I need to display textarea on step 3, and once again the same textarea on step 4 so that user has another chance to review what s/he's written in and on the fifth page all date submitted to db. The problem though is that it adds slashes, and on the submission page (page 5) there's like three slashes for the info collected via textarea. Basically, for instance I submit I'm Russian on step 3, by the time this data reached final step it's I\\\'m Russian. How can I overcome this issue? If I avoid putting variable taken from step 3 to 4th into textarea name=about_eng $about_eng/textarea and do input type=hidden name=about_eng value=about_eng half of the data gets lost, only first word from the submitted previously remains... Hope this was descriptive and hope someone can suggest something. Thanks, Vlad -- 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea/textarea
On Thursday, March 14, 2002, at 10:26 AM, Vlad Kulchitski wrote: The only problem I have is I need to display textarea on step 3, and once again the same textarea on step 4 so that user has another chance to review what s/he's written in and on the fifth page all date submitted to db. The problem though is that it adds slashes, and on the submission page (page 5) there's like three slashes for the info collected via textarea. Basically, for instance I submit I'm Russian on step 3, by the time this data reached final step it's I\\\'m Russian. Does the stripslashes() function solve your problem? I'm interested in hearing about it. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea
i think you don't understand the problem it's just a textarea, no php has to do with it: textarea name='test'/textarea when i try to FILL it with tekst (so, in my browser) it is working for a certain amount of characters, but above it, the submit button is clickable, but doesn't take any action... Edward - Original Message - From: Bas Jobsen [EMAIL PROTECTED] To: Edward van Bilderbeek - Bean IT [EMAIL PROTECTED] Sent: Wednesday, February 27, 2002 4:53 PM Subject: Re: [PHP] textarea textarea echo addslashes($text); /textarea Op woensdag 27 februari 2002 16:38, schreef u: Hi, I've got a strange HTML problem... When I have a textarea, and put a large text in it, the submit button isn't working if the text is very long, but it is working till a certain amount of characters (didn't check out which amount) I can click as many times as i want on the submit button, as long as my text isn't shorter, it won't submit any solutions? Edward PS. I haven't done anything with javascript which might prevent the form from taking action -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] textarea
I think, what he's trying to say is check to make sure it's not an errant quote and not a string length issue. The same behavior may be caused by an errant quote. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Edward van Bilderbeek - Bean IT [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 9:45 AM To: PHP-General Subject: Re: [PHP] textarea i think you don't understand the problem it's just a textarea, no php has to do with it: textarea name='test'/textarea when i try to FILL it with tekst (so, in my browser) it is working for a certain amount of characters, but above it, the submit button is clickable, but doesn't take any action... Edward - Original Message - From: Bas Jobsen [EMAIL PROTECTED] To: Edward van Bilderbeek - Bean IT [EMAIL PROTECTED] Sent: Wednesday, February 27, 2002 4:53 PM Subject: Re: [PHP] textarea textarea echo addslashes($text); /textarea Op woensdag 27 februari 2002 16:38, schreef u: Hi, I've got a strange HTML problem... When I have a textarea, and put a large text in it, the submit button isn't working if the text is very long, but it is working till a certain amount of characters (didn't check out which amount) I can click as many times as i want on the submit button, as long as my text isn't shorter, it won't submit any solutions? Edward PS. I haven't done anything with javascript which might prevent the form from taking action -- 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] textarea
On Wednesday 27 February 2002 23:44, Edward van Bilderbeek - Bean IT wrote: i think you don't understand the problem it's just a textarea, no php has to do with it: You said it yourself, so what's this doing on a PHP list :) textarea name='test'/textarea when i try to FILL it with tekst (so, in my browser) it is working for a certain amount of characters, but above it, the submit button is clickable, but doesn't take any action... Browsers have a limit to the amount of stuff you can enter into a textarea. You're probably coming up against that limit. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* An age is called Dark not because the light fails to shine, but because people refuse to see it. -- James Michener, Space */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] textarea
Maybe it's just an issue of using get rather than post. in the form. Hugh For every complex and difficult problem there is always a simple, easy answer--that's wrong. - Original Message - From: Jason Wong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 27, 2002 8:55 AM Subject: Re: [PHP] textarea On Wednesday 27 February 2002 23:44, Edward van Bilderbeek - Bean IT wrote: i think you don't understand the problem it's just a textarea, no php has to do with it: You said it yourself, so what's this doing on a PHP list :) textarea name='test'/textarea when i try to FILL it with tekst (so, in my browser) it is working for a certain amount of characters, but above it, the submit button is clickable, but doesn't take any action... Browsers have a limit to the amount of stuff you can enter into a textarea. You're probably coming up against that limit. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* An age is called Dark not because the light fails to shine, but because people refuse to see it. -- James Michener, Space */ -- 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] textarea form input converting lt; and gt; to
Hi Byron: Byron Albert wrote: The major problem here is that some times we want lt; and some times we want to input html tags. The solution depends on what you're trying to do. What's your goal. Are you using the text area to store full web pages, or examples of how to write HTML, or See you, --Dan -- PHP scripts that make your job easier http://www.analysisandsolutions.com/code/ SQL Solution | Layout Solution | Form Solution T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Ave, Brooklyn NY 11232v: 718-854-0335f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Textarea returns causing havoc
Here is how i do it, and it works: $tmp_desc = str_replace(\t, , str_replace(\n, , str_replace(\r, , $desc))); $desc = $tmp_desc; \t for stipping TABs also - Original Message - From: Sam [EMAIL PROTECTED] Subject: [PHP] Textarea returns causing havoc Hi all, into this: Hi my name is Sam Rose I have tried nl2br() str_replace() -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] textarea -- what happens to my new lines
At 13:10 03.05.01 +0200, you wrote: I am making a e-card page, and I am having a problem with with my message box which is a textarea when I am previewing or saving/recalling the text all the newline characters are gone. Any good ideas! Thanks Lars Stampe Try textarea name=foo rows=10 cols=50 wrap=physical/textarea this make hard LF´s Oliver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] textarea -- what happens to my new lines
Thanks for the idea, it didn't work, let me just explain a bit further! this is a simple version of the code input.htm:: form name=form method=get action=show.php textarea name=textfield cols=45 rows=5 wrap=HARD/textarea p input type=submit name=Submit value=Submit /form show.php:: ?php echo $textfield; ? When I put in : 1 2 3 4 I get: 1 2 3 4 how do I fix this ( want it to appear like it was typed!)? Regards Lars Stampe -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 03 May 2001 12:44 To: Stampe, Lars; [EMAIL PROTECTED] Subject: Re: [PHP] textarea -- what happens to my new lines At 13:10 03.05.01 +0200, you wrote: I am making a e-card page, and I am having a problem with with my message box which is a textarea when I am previewing or saving/recalling the text all the newline characters are gone. Any good ideas! Thanks Lars Stampe Try textarea name=foo rows=10 cols=50 wrap=physical/textarea this make hard LF´s Oliver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] textarea -- what happens to my new lines
okay,...now that you showed some code... basically, when you input via textarea all new lines are in the string like \n so to display them correctly in show.php do like: pre ?=$lines? /pre basically, in HTML the '\n' doesn't show you a new line, or else you can replace all the '\n' with 'br' tag! -elias www.eassoft.cjb.net Stampe, Lars [EMAIL PROTECTED] wrote in message 06D1C9FA1087D4119FC900508B95056E768ABF@eulexch1a">news:06D1C9FA1087D4119FC900508B95056E768ABF@eulexch1a... Thanks for the idea, it didn't work, let me just explain a bit further! this is a simple version of the code input.htm:: form name=form method=get action=show.php textarea name=textfield cols=45 rows=5 wrap=HARD/textarea p input type=submit name=Submit value=Submit /form show.php:: ?php echo $textfield; ? When I put in : 1 2 3 4 I get: 1 2 3 4 how do I fix this ( want it to appear like it was typed!)? Regards Lars Stampe -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 03 May 2001 12:44 To: Stampe, Lars; [EMAIL PROTECTED] Subject: Re: [PHP] textarea -- what happens to my new lines At 13:10 03.05.01 +0200, you wrote: I am making a e-card page, and I am having a problem with with my message box which is a textarea when I am previewing or saving/recalling the text all the newline characters are gone. Any good ideas! Thanks Lars Stampe Try textarea name=foo rows=10 cols=50 wrap=physical/textarea this make hard LF´s Oliver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] textarea -- what happens to my new lines
Try this: ?php $textfield = nl2br($textfield); echo $textfield; ? For more info, have a look at http://www.php.net/nl2br. HTH Jon -Original Message- From: Stampe, Lars [mailto:[EMAIL PROTECTED]] Sent: 03 May 2001 13:35 To: [EMAIL PROTECTED] Subject: RE: [PHP] textarea -- what happens to my new lines Thanks for the idea, it didn't work, let me just explain a bit further! this is a simple version of the code input.htm:: form name=form method=get action=show.php textarea name=textfield cols=45 rows=5 wrap=HARD/textarea p input type=submit name=Submit value=Submit /form show.php:: ?php echo $textfield; ? When I put in : 1 2 3 4 I get: 1 2 3 4 how do I fix this ( want it to appear like it was typed!)? Regards Lars Stampe ** 'The information included in this Email is of a confidential nature and is intended only for the addressee. If you are not the intended addressee, any disclosure, copying or distribution by you is prohibited and may be unlawful. Disclosure to any party other than the addressee, whether inadvertent or otherwise is not intended to waive privilege or confidentiality' ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] textarea -- what happens to my new lines
At 14:34 03.05.01 +0200, you wrote: change wrap ! textarea name=textfield cols=45 rows=5 wrap=physical/textarea physical means pyhsical not HARD echo nl2br($textfield); //turns your nl´s in br´s That should work Oliver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]