Re: [PHP] Textarea to road a text file

2009-10-30 Thread Jean Lee
Yes, I just want to edit a file in the textarea!
thank you.

""Jay Blanchard""  wrote in message 
news:31454d514ff9a949b1fdfe294d5d1d80080...@ygex01wal.onecall.local...
[snip]
.
..

" . $contents . "";

?>



[/snip]

Try http://us3.php.net/manual/en/function.file-get-contents.php

" . $contents . "";

?>

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

2009-10-29 Thread Jay Blanchard
[snip]
.
..

" . $contents . "";

?>



[/snip]

Try http://us3.php.net/manual/en/function.file-get-contents.php

" . $contents . "";

?>

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

2009-10-29 Thread John Black

Jean Lee wrote:

Could you explain what was my fault concerned about this case?
" . $contents . "";
?>


As Andrew pointed out, you need to use htmlspecialchars()
	echo "" .htmlspecialchars($contents). 
"";


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

2009-10-28 Thread Jean Lee
Thank you, Jay Blanchard and Andrew Ballard!!!

Could you explain what was my fault concerned about this case?
Thanks in advance!
My codes were


.
..

" . $contents . "";

?>






""Jay Blanchard""  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 to road a text file

2009-10-28 Thread Andrew Ballard
On Wed, Oct 28, 2009 at 10:39 AM, Jean Lee  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.



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

2009-10-28 Thread Jay Blanchard
[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

2009-05-15 Thread tedd

At 2:10 PM -0400 5/15/09, Tom Worster wrote:

On 5/15/09 10:12 AM, "Stuart"  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 new line to mysql database

2009-05-15 Thread Tom Worster
On 5/15/09 10:12 AM, "Stuart"  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

2009-05-15 Thread Michael A. Peters

tedd wrote:



Also, one can generate validation errors using "" because there 
are three different varieties of the tag, namely "", "", and 
"" -- 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

2009-05-15 Thread tedd

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  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 .

Cheers,
Rob.
--


That would be my first choice as well. However, one can style a  
tag whereas it's very difficult (if not impossible) to style what 
goes in between  tags.


Also, one can generate validation errors using "" because there 
are three different varieties of the tag, namely "", "", 
and "" -- 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

2009-05-15 Thread Michael A. Peters

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  for html or  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

2009-05-15 Thread tedd

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 ? Is this a PHP
 problem or more a HTML problem?


HTML doesn't recognize newlines when it displays text. The  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

2009-05-15 Thread tedd

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  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

2009-05-15 Thread Robert Cummings
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 ? Is this a PHP
> > problem or more a HTML problem?
> 
> HTML doesn't recognize newlines when it displays text. The  tag
> maintains the formatting of your original text, including newlines.
> Unfortunately, it also displays text in a monospace font.

You can style a  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

2009-05-15 Thread Paul M Foster
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 ? Is this a PHP
> problem or more a HTML problem?

HTML doesn't recognize newlines when it displays text. The  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

2009-05-15 Thread Robert Cummings
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  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  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 .

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-05-15 Thread Manoj Sterex
@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  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  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  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

2009-05-15 Thread tedd

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  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  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

2009-05-15 Thread Stuart
2009/5/15 PHPScriptor :
>
> 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 :
>>>
>>> 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

2009-05-15 Thread Manoj Sterex
TinyMCE: http://tinymce.moxiecode.com/

-Sterex

On Fri, May 15, 2009 at 7:56 PM, Paul M Foster wrote:

> 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-05-15 Thread Manoj Sterex
@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 wrote:

> 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  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

2009-05-15 Thread Manoj Sterex
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 ''.

Coming to the  tag,  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 wrote:

>
> 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 linesecond 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  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  wrote:
> >
> >> 2009/5/15 PHPScriptor :
> >> >
> >> > 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

2009-05-15 Thread Paul M Foster
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-05-15 Thread Robert Cummings
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  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

2009-05-15 Thread PHPScriptor

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 linesecond 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  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  wrote:
> 
>> 2009/5/15 PHPScriptor :
>> >
>> > 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

2009-05-15 Thread PHPScriptor

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 :
>>
>> 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

2009-05-15 Thread PHPScriptor

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 ? 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
>  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

2009-05-15 Thread Manoj Sterex
Well, instead of storing the text from the textarea directly into the db,
validate it and wrap it with  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  wrote:

> 2009/5/15 PHPScriptor :
> >
> > 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

2009-05-15 Thread Stuart
2009/5/15 PHPScriptor :
>
> 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

2009-05-15 Thread Robert Cummings
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
 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 html generation problem

2008-09-18 Thread sean greenslade
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  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 
>
>
>


-- 
Feh.


Re: [PHP] textarea html generation problem

2008-09-16 Thread sean greenslade
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.



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  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



Re: [PHP] textarea html generation problem

2008-09-16 Thread Ashley Sheridan
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 
> 
> 
> 
> 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 update problem

2007-03-07 Thread Jim Lucas

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
.


   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! :)



http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
http://www.w3.org/1999/xhtml"; lang="hr">



UPDATE news and article items





 0)
   {
   while ($row = mysql_fetch_array($selResult))
   {
   if (!$_POST["submit"])
   {
   echo '';
   echo "";
   echo '';


You can't do this You are inside a php echo statement already.
Then you are trying to break into php from html

   echo "";


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 "";


   echo "";
   echo "";
   echo "";
   echo "";
   echo "";
   echo "sText";
   echo '';
   echo $row['sText'];
   echo "";
   echo '
   
   fText
   ';
   echo $row['fText'];
   echo '
   
   
   
   
   
   
   
   
   ';
   }
   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 'Povratak na
editiranje';
   }
   else
   {
   echo "Data update FAILED";
   }
   mysql_close($link);
   }
   }
   }

?>






--
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 update problem

2007-03-07 Thread Németh Zoltán
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
> .
> 
> 
> 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! :)
> 
> 
> 
>  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> http://www.w3.org/1999/xhtml"; lang="hr">
> 
> 
> 
> UPDATE news and article items
> 
> 
> 
> 
> 
>  
> $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 ' align="center">';
> echo "";
> echo '';
> echo "";
> echo " value=" . $row['title'] .">";
> echo "";
> echo "";
> echo "";
> echo "";
> echo "sText";
> echo '';
> echo $row['sText'];
> echo "";
> echo '
> 
> fText
> ';
> echo $row['fText'];
> echo '
> 
> 
> 
> 
> 
> 
> 
> 
> ';
> }
> 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 'Povratak na
> editiranje';
> }
> else
> {
> echo "Data update FAILED";
> }

and this "else" part is also totally useless, as it never gets here. it
there is an error it dies right at the query, otherwise it is successful

> mysql_

Re: [PHP] Textarea update problem

2007-03-07 Thread Tijnema !

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
.


   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! :)



http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
http://www.w3.org/1999/xhtml"; lang="hr">



UPDATE news and article items





 0)
   {
   while ($row = mysql_fetch_array($selResult))
   {
   if (!$_POST["submit"])
   {
   echo '';
   echo "";
   echo '';
   echo "";
   echo "";
   echo "";
   echo "";
   echo "";
   echo "";
   echo "sText";
   echo '';
   echo $row['sText'];
   echo "";
   echo '
   
   fText
   ';
   echo $row['fText'];
   echo '
   
   
   
   
   
   
   
   
   ';
   }
   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 'Povratak na
editiranje';
   }
   else
   {
   echo "Data update FAILED";
   }
   mysql_close($link);
   }
   }
   }

?>



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Textarea update problem

2007-03-07 Thread Delta Storm

[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
.


   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! :)



http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
http://www.w3.org/1999/xhtml"; lang="hr">



UPDATE news and article items





 0)
   {
   while ($row = mysql_fetch_array($selResult))
   {
   if (!$_POST["submit"])
   {
   echo '';
   echo "";
   echo '';
   echo "";
   echo "";
   echo "";
   echo "";
   echo "";
   echo "";
   echo "sText";
   echo '';
   echo $row['sText'];
   echo "";
   echo '
   
   fText
   ';
   echo $row['fText'];
   echo '
   
   
   
   
   
   
   
   
   ';
   }
   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 'Povratak na
editiranje';
   }
   else
   {
   echo "Data update FAILED";
   }
   mysql_close($link);
   }
   }
   }

?>



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] textarea posting duplicate text

2005-03-01 Thread Frank Arensmeier
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

2005-03-01 Thread John Holmes
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

2005-03-01 Thread Dan Tappin
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:


TEST









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:


Test PHP Script




//[a bunch of text goes here]




if ($_POST[Submit] != "")
{
  echo "_POST values";
  echo "Textarea submitted:";
  echo "" . $_POST[textarea] . "";
  echo "Textbox submitted:";
  echo "" . $_POST[text] . "";
  echo "Submit submitted:";
  echo "" . $_POST[Submit] . "";
}
?>


phpinfo();
?>



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

2005-03-01 Thread Bret Hughes
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

2005-03-01 Thread 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



RE: [PHP] textarea posting duplicate text

2005-03-01 Thread Elizabeth Lawrence
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:



TEST












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:
>
> 
>
> 
>
> Test PHP Script
>
> 
>
> 
>
> 
>
> 
>
> //[a bunch of text goes here]
>
> 
>
> 
>
> 
>
> 
> if ($_POST[Submit] != "")
>
> {
>
>   echo "_POST values";
>
>   echo "Textarea submitted:";
>
>   echo "" . $_POST[textarea] . "";
>
>   echo "Textbox submitted:";
>
>   echo "" . $_POST[text] . "";
>
>   echo "Submit submitted:";
>
>   echo "" . $_POST[Submit] . "";
>
> }
>
> ?>
>
> 
>
> 
> phpinfo();
>
> ?>
>
> 
>
> 
>
>
>
> 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

2005-02-28 Thread Richard Lynch
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:
 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

2005-01-18 Thread Richard Lynch
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 and Php

2005-01-18 Thread Hugh Danaher
Ross,
Try something like this in your form:
$description
You can then edit the contents of the cell
Hope this helps.
Hugh
- Original Message - 
From: "Ross Hulford" <[EMAIL PROTECTED]>
To: 
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 vs. type="text" data difference?

2004-10-11 Thread Gryffyn, Trevor
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?

2004-10-10 Thread Sam Smith

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","",$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","",$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?

2004-10-10 Thread Minuk Choi
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","",$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","",$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?

2004-10-10 Thread Greg Donald
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?

2004-10-10 Thread Sam Smith

##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","",$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","",$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/display question...

2004-07-21 Thread John W. Holmes
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 ... 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  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...

2004-07-21 Thread Dennis Gearon
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...

2004-07-20 Thread Marek Kilimajer
bruce wrote:
$foo = 'blah';

Everything but one thing has been said: You should always use 
htmlspecialchars() to output value of textarea

$foo = 'blah';
echo '' . htmlspecialchars($foo) . '';
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] textarea/display question...

2004-07-20 Thread Pablo Gosse
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  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  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...

2004-07-20 Thread Stut
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  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  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...

2004-07-20 Thread John W. Holmes
bruce wrote:
ps.. to you guys who said that the  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...

2004-07-20 Thread Jason Davidson
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  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  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
>  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 = 'blah';
> 
> 
> 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...

2004-07-20 Thread Matthew Sims
>
> ps.. to you guys who said that the  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
--

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] textarea/display question...

2004-07-20 Thread Matt M.
> ps.. to you guys who said that the  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...

2004-07-20 Thread Vail, Warren
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 "";
For($row = 0; $row < $height; $row++) {
echo "";
for($col = 0; $col < $width; $col++) {
  echo "\n";
}
echo "";
}
Echo "";

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  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  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
 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 = 'blah';


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...

2004-07-20 Thread Vail, Warren
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  list;


this is a


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  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  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
 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 = 'blah';


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...

2004-07-20 Thread Justin Patrin
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
>  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 = 'blah';
> 
> 
> 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  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...

2004-07-20 Thread bruce
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  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  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
 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 = 'blah';


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...

2004-07-20 Thread John W. Holmes
bruce wrote:

Please review your HTML textbook. There is no "value" attribute for a 
textarea.

$foo
--
---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...

2004-07-20 Thread Will Collins
I've always gotten errors when trying to use the "value" property of a
textarea.  Put the value info between the  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
 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 = 'blah';


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...

2004-07-20 Thread Vail, Warren
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  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
 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 = 'blah';


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...

2004-07-20 Thread Dan Joseph
Hi,

With textarea, there is no value...

$foo

-Dan Joseph

> $foo = 'blah';
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] textarea/display question...

2004-07-20 Thread Jonathan Haddad
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
 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 = 'blah';

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 and quotes

2004-05-05 Thread John W. Holmes
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 : 
> 
> becomes : 
> 
> 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?

2003-07-15 Thread Marek Kilimajer
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 .

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

2003-07-09 Thread Arcadius A.

"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();
> 
>
>

Thanks!!! :-)



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] TextArea vs. URLEncode/URLDecode/quotes

2003-07-09 Thread Marek Kilimajer
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();

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:
 
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

2003-07-09 Thread Kevin Stone

- 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 problem

2003-01-23 Thread Ernest E Vogelsinger
At 14:34 23.01.2003, Denis L. Menezes said:
[snip]
>  Print 'value="'.htmlspecialchars($row['OrgName']).'">';
>  ?>
[snip] 

This won't work.  needs its value outside the tag, without an
attribute, just plain:

Print '',
  htmlspecialchars($row['OrgName']),
'';


-- 
   >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+mysql update

2002-07-05 Thread colin mcdonald

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 "$string";
>>
>>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

2002-07-05 Thread adi

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 "$string";
>
> 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

2002-07-05 Thread PHPCoder

When you echo, you are adding to HTML, so you need  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 "$string";




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 "$string";
>
>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

2002-07-05 Thread PHPCoder

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  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 "$string";
>
>
>
>
> 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 "$string";
>>
>> 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

2002-02-27 Thread hugh danaher

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 :)
>
> > 
> >
> > 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
.
> 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

2002-02-27 Thread Jason Wong

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 :)

> 
>
> 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 . 
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

2002-02-27 Thread Cal Evans

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:



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


> 
> echo addslashes($text);
> 
>
> 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

2002-02-27 Thread Edward van Bilderbeek - Bean IT

i think you don't understand the problem

it's just a textarea, no php has to do with it:



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


> 
> echo addslashes($text);
> 
>
> 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 form input converting < and > to < >

2002-02-20 Thread Analysis and Solutions

Hi Byron:

Byron Albert wrote:
> 
> The major problem here is that some times we want < 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, carriage returns and formatting

2001-11-20 Thread Jim Lucas

not sure what you're getting at.  when you pull the text back out of the DB,
it should be formatted the same as when it was put in the DB.

the \n's should still be intack

are you processing the text before it gets entered into the DB?

You should be able to do this:



Jim
- Original Message -
From: "Chris Aitken" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 20, 2001 3:34 PM
Subject: [PHP] textarea, carriage returns and formatting


> Hi,
>
> Something ive been trying to find out but cant seem to get the wording
> right to find the answers in the archives.
>
> What I have is a mysql database, and in that DB I have a field which is
> just a 'text' field. What I want to be able to do is write whatever text
> is typed from the webforms textarea into the 'text' field, formatting in
> tact. For example if this was typed into a textarea
>
> --
> This is some text ive typed
> I have some single and double
>
> carriage returns in there, and I
> want it to keep the formatting
> --
>
> When I pull it back out of the DB, I want to be able to display it back in
> a textarea with the carriage returns in place exactly as it was typed in.
>
> Can anyone point me in the right direction. Is there a php function which
> can convert/reconvert on the display from/insert to the database, or am I
> missing something totally with this.
>
>
> Thanks
>
>
>
> Chris
>
>
> --
> 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 returns causing havoc

2001-05-09 Thread Rares

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

2001-05-03 Thread heinisch

At 14:34 03.05.01 +0200, you wrote:

change wrap !

"physical means pyhsical" not HARD

echo nl2br($textfield); //turns your nl´s in ´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]




RE: [PHP] textarea -- what happens to my new lines

2001-05-03 Thread Jon Haworth

Try this:



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::


  
  
  


show.php::





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

2001-05-03 Thread elias

okay,...now that you showed some code...
basically, when you input via  all new lines are in the string
like \n
so to display them correctly in show.php do like:



basically, in HTML the '\n' doesn't show you a new line,
or else you can replace all the '\n' with '' 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::


  
  
  


show.php::





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  when I am previewing or saving/recalling the text
>all the newline characters are gone. Any good ideas!
>
>Thanks
>Lars Stampe

Try

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

2001-05-03 Thread Stampe, Lars

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::


  
  
  


show.php::





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  when I am previewing or saving/recalling the text
>all the newline characters are gone. Any good ideas!
>
>Thanks
>Lars Stampe

Try

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

2001-05-03 Thread heinisch

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  when I am previewing or saving/recalling the text
>all the newline characters are gone. Any good ideas!
>
>Thanks
>Lars Stampe

Try

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]