[PHP] htmlentities

2011-09-13 Thread Ron Piggott
Is there a way to only change accented characters and not HTML (Example: p /p a href =”” /a ) The syntax echo htmlentities( stripslashes(mysql_result($whats_new_result,0,message)) ) . \r\n; is doing everything (as I expect). I store breaking news within the database as HTML formatted text.

Re: [PHP] htmlentities

2011-09-13 Thread Marc Guay
You could store the accented characters in your DB if you set everything to UTF-8, including calling the SET NAMES utf8 MySQL command after connecting. I find this much easier than encoding/decoding. Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] htmlentities is incomplete: does not cover rsquo etc

2009-03-14 Thread Lester Caine
Heddon's Gate Hotel wrote: Thanks Jan, it's much clearer now. My knowledge about character encodings has multiplied 100-fold in the last 24 hours' research. Would it be a good idea for the PHP Manual to address some of these issues, by explaining good practice in encoding arbitrary user

Re: [PHP] htmlentities is incomplete: does not cover rsquo etc

2009-03-14 Thread mike
On Sat, Mar 14, 2009 at 12:18 AM, Lester Caine les...@lsces.co.uk wrote: This probably one of the reasons some of us think that getting a stable PHP6 based on unicode out of the door would probably be a lot more use to people than PHP5.3 ;) +1 I cannot wait for full unicode. mbstring, iconv,

Re: [PHP] htmlentities is incomplete: does not cover rsquo etc

2009-03-13 Thread Jan G.B.
2009/3/13 Heddon's Gate Hotel ho...@heddonsgate.co.uk: The string function htmlentities seems to have very incomplete coverage of the HTML entities listed in the HTML 4 spec.  For example, it does not know about rsquo, lsquo, rdquo, ldquo, etc.  This is confirmed by looking at the output of

Re: [PHP] htmlentities is incomplete: does not cover rsquo etc

2009-03-13 Thread Heddon's Gate Hotel
Thanks Jan, it's much clearer now. My knowledge about character encodings has multiplied 100-fold in the last 24 hours' research. Would it be a good idea for the PHP Manual to address some of these issues, by explaining good practice in encoding arbitrary user input in forms (for example),

[PHP] htmlentities is incomplete: does not cover rsquo etc

2009-03-12 Thread Heddon's Gate Hotel
The string function htmlentities seems to have very incomplete coverage of the HTML entities listed in the HTML 4 spec. For example, it does not know about rsquo, lsquo, rdquo, ldquo, etc. This is confirmed by looking at the output of get_html_translation_table, which does not list these

[PHP] HTMLEntities as NUMERIC for XML

2008-11-25 Thread ceo
After reading this: http://validator.w3.org/feed/docs/error/UndefinedNamedEntity.html (all praise W3.org!) I am searching for a PHP library function that will convert all my abc; into #123; I have a zillion of these things from converting stupid MS Word characters into something that

RE: [PHP] HTMLEntities as NUMERIC for XML

2008-11-25 Thread Boyd, Todd M.
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 25, 2008 11:28 AM To: php-general@lists.php.net Subject: Re: [PHP] HTMLEntities as NUMERIC for XML I came across a similar problem using an AJAX thing, with MSWord characters

Re: [PHP] HTMLEntities as NUMERIC for XML

2008-11-25 Thread ceo
I came across a similar problem using an AJAX thing, with MSWord characters in the text. The way round the problem was to enclose everything inside CDATA blocks, which made the browsers happy to receive as the entities only had to be understood by the HTML browser now, not the XML

[PHP] htmlentities() and default_charset

2008-11-08 Thread Jim Hermann - UUN Hostmaster
Folks, Why should htmlentities() use the default_charset for $charset with this example, taken from ext/standard/tests/strings/htmlentities10.phpt? ?php ini_set('mbstring.internal_encoding','pass'); ini_set('default_charset','cp1252');

Re: [PHP] htmlentities() does not remove escape

2008-01-28 Thread Richard Lynch
On Sun, January 27, 2008 12:27 pm, jekillen wrote: Hello: I have a form that has a textarea and I do not want to disallow the use of single quote as apostrophe, or for any other normal stylization. So I am using html entities to change these characters into html entities. But the function

[PHP] htmlentities() does not remove escape

2008-01-27 Thread jekillen
Hello: I have a form that has a textarea and I do not want to disallow the use of single quote as apostrophe, or for any other normal stylization. So I am using html entities to change these characters into html entities. But the function does not remove the escapes added by the browser when

Re: [PHP] htmlentities() does not remove escape

2008-01-27 Thread Nathan Nobbe
On Jan 27, 2008 1:27 PM, jekillen [EMAIL PROTECTED] wrote: Hello: I have a form that has a textarea and I do not want to disallow the use of single quote as apostrophe, or for any other normal stylization. So I am using html entities to change these characters into html entities. But the

Re: [PHP] htmlentities() does not remove escape

2008-01-27 Thread Robert Cummings
On Sun, 2008-01-27 at 10:27 -0800, jekillen wrote: Hello: I have a form that has a textarea and I do not want to disallow the use of single quote as apostrophe, or for any other normal stylization. So I am using html entities to change these characters into html entities. But the function

Re: [PHP] htmlentities() does not remove escape

2008-01-27 Thread jekillen
On Jan 27, 2008, at 10:37 AM, Nathan Nobbe wrote: On Jan 27, 2008 1:27 PM, jekillen [EMAIL PROTECTED] wrote: I have a form that has a textarea and I do not want to disallow the use of single quote as apostrophe, or for any other normal stylization. So I am using html entities to change these

[PHP] htmlentities()

2007-11-17 Thread Ronald Wiplinger
I tried to understand htmlentities by putting this code into a test.php: ?php if(!$page) { ? H3Test of evil input/H3 form method=post action=?php echo $PHP_SELF? INPUT type=text name=field1 size=100 maxlength=100 INPUT type=hidden name=page value=1 INPUT type=submit name=submit value=Check it!

Re: [PHP] htmlentities()

2007-11-17 Thread Ludovic André
Hi, I tried to understand htmlentities by putting this code into a test.php: [...] The output on the screen is: field1=*Greater input and lower input* field2=bGreater input and lower input/b bGreater input and lower input/b A 'quote' is bbold/b A 'quote' is bbold/b I expected that it

Re: [PHP] htmlentities()

2007-11-17 Thread Casey
It is doing that ;) If you look at the source, you will see the expected output. On Nov 17, 2007, at 4:41 AM, Ronald Wiplinger [EMAIL PROTECTED] wrote: I tried to understand htmlentities by putting this code into a test.php: ?php if(!$page) { ? H3Test of evil input/H3 form method=post

Re: [PHP] htmlentities()

2007-11-17 Thread Jim Lucas
Ronald Wiplinger wrote: I tried to understand htmlentities by putting this code into a test.php: ?php if(!$page) { ? H3Test of evil input/H3 form method=post action=?php echo $PHP_SELF? INPUT type=text name=field1 size=100 maxlength=100 INPUT type=hidden name=page value=1 INPUT type=submit

[PHP] Htmlentities vs htmlspecialchars

2006-07-26 Thread Dave Goodchild
Hi all. I know htmlspecialchars converts the smallest set of entities possible to generate valid HTML, and that htmlentities goes much further, so what is the difference? Is it not better to use htmlentities in every case, making htmlspecialchars somewhat redundant, or is there a performance

Re: [PHP] Htmlentities vs htmlspecialchars

2006-07-26 Thread Jochem Maas
Dave Goodchild wrote: Hi all. I know htmlspecialchars converts the smallest set of entities possible to generate valid HTML, and that htmlentities goes much further, so what is the difference? Is it not better to use htmlentities in every case, making htmlspecialchars somewhat redundant, or

Re: [PHP] Htmlentities vs htmlspecialchars

2006-07-26 Thread Michael Rasmussen
On Wed, 26 Jul 2006 14:59:46 +0200, Jochem Maas wrote: I wonder if anyone can given a solid answer to this? If I remember correctly, htmlspecialchars does what its name indicate: konvert any character with special meaning according to the HTML specification. htmlentities converts any character

Re: [PHP] htmlentities() with utf8

2006-05-08 Thread Eric Butera
On 5/4/06, Marten Lehmann [EMAIL PROTECTED] wrote: Hello, I want to use htmlentities() with UTF-8, which I can set with the third parameter. But to use the third parameter, I have to provide the second parameter. Currently the default for the second parameter is ENT_COMPAT. But as this might

[PHP] htmlentities() with utf8

2006-05-04 Thread Marten Lehmann
Hello, I want to use htmlentities() with UTF-8, which I can set with the third parameter. But to use the third parameter, I have to provide the second parameter. Currently the default for the second parameter is ENT_COMPAT. But as this might change, I don't want to call htmlentities with

Re: [PHP] htmlentities() with utf8

2006-05-04 Thread Richard Lynch
On Thu, May 4, 2006 11:02 am, Marten Lehmann wrote: I want to use htmlentities() with UTF-8, which I can set with the third parameter. But to use the third parameter, I have to provide the second parameter. Currently the default for the second parameter is ENT_COMPAT. But as this might

Re: [PHP] htmlentities() with utf8

2006-05-04 Thread Chris
Marten Lehmann wrote: Hello, I want to use htmlentities() with UTF-8, which I can set with the third parameter. But to use the third parameter, I have to provide the second parameter. Currently the default for the second parameter is ENT_COMPAT. But as this might change, I don't want to call

[PHP] htmlentities()

2004-09-08 Thread Anthony Ritter
Copied and pasted the following sample script from the php manual and this outputs: ... ?php $str = A 'quote' is bbold/b; echo htmlentities($str); ? .. // outputs: A 'quote' is bbold/b Not sure why the I am still getting the tags and spaces after the call to htmlentities().

Re: [PHP] htmlentities()

2004-09-08 Thread Chris Shiflett
--- Anthony Ritter [EMAIL PROTECTED] wrote: Copied and pasted the following sample script from the php manual and this outputs: ... ?php $str = A 'quote' is bbold/b; echo htmlentities($str); ? .. // outputs: A 'quote' is bbold/b Not sure why the I am still

Re: [PHP] htmlentities()

2004-09-08 Thread Jim Grill
Copied and pasted the following sample script from the php manual and this outputs: ... ?php $str = A 'quote' is bbold/b; echo htmlentities($str); ? .. // outputs: A 'quote' is bbold/b Not sure why the I am still getting the tags and spaces after the call to

Re: [PHP] htmlentities()

2004-09-08 Thread Jim Grill
Copied and pasted the following sample script from the php manual and this outputs: ... ?php $str = A 'quote' is bbold/b; echo htmlentities($str); ? .. // outputs: A 'quote' is bbold/b Not sure why the I am still getting the tags and spaces after the call to

Re: [PHP] htmlentities()

2004-09-08 Thread Anthony Ritter
Chris Shiflett wrote: View source, and I think you'll understand. Or, remove the call to htmlentities(). Chris .. Thank you all for your assistance. Best... TR ... ...when a browser sees lt, it prints out a character instead of thinking OK here comes an HTML tag.

[PHP] htmlentities and foreign characters from MS Word

2004-09-05 Thread Monty
I'm having a problem figuring out how to deal with foreign characters in text that was copied from an MS Word document and pasted into a form field. I'm not how sure this is getting stored in the MySQL database, but, when I run htmlentities() on this text, each foreign character is converted into

[PHP] htmlentities, links, javascript

2004-04-12 Thread Beau Hartshorne
hi all, i have a script that calls a popup like this: a href=/popup.php?name=Choicesamp;product_id=15 target=_blank onclick=openWindow(this.href,600,200,'yes'); return false;Choices/a the amp; is there to make sure the page validates. the problem is that some browsers seem to be

[PHP] htmlentities -- can it skip tags

2003-09-14 Thread Justin French
Hi all, I need to convert some text from a database for presentation on screen... as per usual, characters like quotes and ampersands () are giving me grief. the obvious answer is to apply htmlspecialchars(), BUT this also converts all and into lt; and gt; signs, which destroys the html

Re: [PHP] htmlentities -- can it skip tags

2003-09-14 Thread John W. Holmes
Justin French wrote: Hi all, I need to convert some text from a database for presentation on screen... as per usual, characters like quotes and ampersands () are giving me grief. the obvious answer is to apply htmlspecialchars(), BUT this also converts all and into lt; and gt; signs, which

Re: [PHP] htmlentities -- can it skip tags

2003-09-14 Thread Justin French
On Monday, September 15, 2003, at 12:58 PM, John W. Holmes wrote: Justin French wrote: Hi all, I need to convert some text from a database for presentation on screen... as per usual, characters like quotes and ampersands () are giving me grief. the obvious answer is to apply

Re: [PHP] htmlentities -- can it skip tags

2003-09-14 Thread Justin French
On Monday, September 15, 2003, at 12:58 PM, John W. Holmes wrote: Justin French wrote: Hi all, I need to convert some text from a database for presentation on screen... as per usual, characters like quotes and ampersands () are giving me grief. the obvious answer is to apply

[PHP] htmlentities() and the macintosh character set

2003-09-13 Thread Michael Winston
Hello- I have a request but don't know where to send it. Thus, it ends up here. Alternately, I'm looking for some solutions: The request: Can the macintosh character set be added as an option for htmlentities() and other commands? That would be so helpful for our mac-based company. The

Re: [PHP] htmlentities() and the macintosh character set

2003-09-13 Thread Eugene Lee
On Sat, Sep 13, 2003 at 11:24:56AM -0700, Michael Winston wrote: : : The request: Can the macintosh character set be added as an option for : htmlentities() and other commands? That would be so helpful for our : mac-based company. : : The problem: I'm fairly new to php and have found that

[PHP] htmlentities()

2003-02-27 Thread Liam Gibbs
I seem to be having trouble with htmlentities(). Maybe someone has a clue I can borrow. Here's my function: function FitForHTML($string) { $asciitable = get_html_translation_table(HTML_ENTITIES); $string = htmlentities($string, ENT_COMPAT); $string =

[PHP] Htmlentities and Newlines?

2002-09-28 Thread Andre Dubuc
Perhaps I don't understand the use of 'htmlentities' too well, but I would like newlines to be retained/inserted into a db, and then if displayed, to produce a new line from a textarea. However, I want the possibility of dangerous html excluded (hence the use of 'htmlentities'). Is there some

RE: [PHP] Htmlentities and Newlines?

2002-09-28 Thread John W. Holmes
Perhaps I don't understand the use of 'htmlentities' too well, but I would like newlines to be retained/inserted into a db, and then if displayed, to produce a new line from a textarea. However, I want the possibility of dangerous html excluded (hence the use of 'htmlentities'). Is there

Re: [PHP] Htmlentities and Newlines?

2002-09-28 Thread Andre Dubuc
On Saturday 28 September 2002 03:30 pm, John W. Holmes wrote: Perhaps I don't understand the use of 'htmlentities' too well, but I would like newlines to be retained/inserted into a db, and then if displayed, to produce a new line from a textarea. However, I want the possibility of

RE: [PHP] Htmlentities and Newlines?

2002-09-28 Thread John W. Holmes
: Saturday, September 28, 2002 6:25 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Htmlentities and Newlines? On Saturday 28 September 2002 03:30 pm, John W. Holmes wrote: Perhaps I don't understand the use of 'htmlentities' too well, but I would like newlines to be retained

Re: [PHP] Htmlentities and Newlines?

2002-09-28 Thread Andre Dubuc
PROTECTED] Subject: Re: [PHP] Htmlentities and Newlines? On Saturday 28 September 2002 03:30 pm, John W. Holmes wrote: Perhaps I don't understand the use of 'htmlentities' too well, but I would like newlines to be retained/inserted into a db, and then if displayed

RE: [PHP] Htmlentities and Newlines?

2002-09-28 Thread John W. Holmes
Sorry about the ambiguity. What I'm trying to accomplish is close to what you describe. However, before anything goes into the db (ie html chars, bad commands, or anything from Mr.Hacker), I verify it. Someone suggested, way back when I first started with textarea, to use 'htmlentities' to

Re: [PHP] Htmlentities and Newlines?

2002-09-28 Thread Sascha Cunz
Hi John, Sorry about the ambiguity. What I'm trying to accomplish is close to what you describe. However, before anything goes into the db (ie html chars, bad commands, or anything from Mr.Hacker), I verify it. Someone suggested, way back when I first started with textarea, to use

Re: [PHP] Htmlentities and Newlines?

2002-09-28 Thread Andre Dubuc
On Saturday 28 September 2002 07:55 pm, John W. Holmes wrote: Sorry about the ambiguity. What I'm trying to accomplish is close to what you describe. However, before anything goes into the db (ie html chars, bad commands, or anything from Mr.Hacker), I verify it. Someone suggested,

RE: [PHP] Htmlentities and Newlines?

2002-09-28 Thread John W. Holmes
- From: Sascha Cunz [mailto:[EMAIL PROTECTED]] Sent: Saturday, September 28, 2002 8:19 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; php- [EMAIL PROTECTED] Subject: Re: [PHP] Htmlentities and Newlines? Hi John, Sorry about the ambiguity. What I'm trying to accomplish is close to what

Re: [PHP] Htmlentities and Newlines?

2002-09-28 Thread Sascha Cunz
?php /* db access using postgresql - each row is displayed */ ... trtd{$myrow['request']}/td/tr ... ? Now unless I can do something like: trtd'nl2br({$myrow['request']}'/td/tr Try something like echo 'trtd'.nl2br($myrow['request'].'/td/tr'; Regards Sascha -- PHP General Mailing

Re: [PHP] Htmlentities and Newlines?

2002-09-28 Thread Andre Dubuc
On Saturday 28 September 2002 08:19 pm, Sascha Cunz wrote: Hi John, Sorry about the ambiguity. What I'm trying to accomplish is close to what you describe. However, before anything goes into the db (ie html chars, bad commands, or anything from Mr.Hacker), I verify it. Someone

Re: [PHP] Htmlentities and Newlines?

2002-09-28 Thread Sascha Cunz
Yeah, good catch on the addslash/magic_quote. Also, FYI: PHP will only allow you to do one query per mysql_query(). So you can't try to end a quote and then send another query. Don't know if this is the case for all database functions, or what... Does PHP this? Such behaviour would be

RE: [PHP] Htmlentities and Newlines?

2002-09-28 Thread John W. Holmes
-Original Message- From: Andre Dubuc [mailto:[EMAIL PROTECTED]] Sent: Saturday, September 28, 2002 8:34 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Htmlentities and Newlines? On Saturday 28 September 2002 07:55 pm, John W. Holmes wrote: Sorry about

Re: [PHP] Htmlentities and Newlines?

2002-09-28 Thread Rasmus Lerdorf
Yeah, good catch on the addslash/magic_quote. Also, FYI: PHP will only allow you to do one query per mysql_query(). So you can't try to end a quote and then send another query. Don't know if this is the case for all database functions, or what... Does PHP this? Such behaviour would be

Re: [PHP] Htmlentities and Newlines?

2002-09-28 Thread Andre Dubuc
On Saturday 28 September 2002 08:32 pm, John W. Holmes wrote: -Original Message- From: Andre Dubuc [mailto:[EMAIL PROTECTED]] Sent: Saturday, September 28, 2002 8:34 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Htmlentities and Newlines? On Saturday 28

RE: [PHP] Htmlentities and Newlines?

2002-09-28 Thread John W. Holmes
Short question: following your advice, what would the data look like in the db if I typed in: Hi Sascha. Next line is doubled. Double. How would that appear iun the db? In mine, it looks exactly like I typed it above (using 1 2 with magic_quotes=on). It depends

Re: [PHP] Htmlentities and Newlines?

2002-09-28 Thread Andre Dubuc
On Saturday 28 September 2002 08:42 pm, John W. Holmes wrote: Short question: following your advice, what would the data look like in the db if I typed in: Hi Sascha. Next line is doubled. Double. How would that appear iun the db? In mine, it looks exactly like

Re: [PHP] Htmlentities and Newlines?

2002-09-28 Thread Sascha Cunz
Does PHP do what? By default the MySQL query function can only take one query at a time. There is nothing strange about this. The command-line mysql tool can take multiple queries separated by semi-colons, but that is something that is implemented in that command-line tool. It is not done

RE: [PHP] Htmlentities and Newlines?

2002-09-28 Thread John W. Holmes
-Original Message- From: Andre Dubuc [mailto:[EMAIL PROTECTED]] Sent: Saturday, September 28, 2002 9:00 PM To: [EMAIL PROTECTED]; 'Sascha Cunz'; [EMAIL PROTECTED] Subject: Re: [PHP] Htmlentities and Newlines? On Saturday 28 September 2002 08:42 pm, John W. Holmes wrote: Short

Re: [PHP] Htmlentities and Newlines?

2002-09-28 Thread Andre Dubuc
On Saturday 28 September 2002 08:59 pm, John W. Holmes wrote: -Original Message- From: Andre Dubuc [mailto:[EMAIL PROTECTED]] Sent: Saturday, September 28, 2002 9:00 PM To: [EMAIL PROTECTED]; 'Sascha Cunz'; [EMAIL PROTECTED] Subject: Re: [PHP] Htmlentities and Newlines

RE: [PHP] Htmlentities and Newlines?

2002-09-28 Thread John W. Holmes
-Original Message- From: Andre Dubuc [mailto:[EMAIL PROTECTED]] Sent: Saturday, September 28, 2002 9:14 PM To: [EMAIL PROTECTED]; 'Sascha Cunz'; [EMAIL PROTECTED] Subject: Re: [PHP] Htmlentities and Newlines? On Saturday 28 September 2002 08:59 pm, John W. Holmes wrote

Re: [PHP] Htmlentities and Newlines?

2002-09-28 Thread Andre Dubuc
On Saturday 28 September 2002 09:13 pm, John W. Holmes wrote: -Original Message- From: Andre Dubuc [mailto:[EMAIL PROTECTED]] Sent: Saturday, September 28, 2002 9:14 PM To: [EMAIL PROTECTED]; 'Sascha Cunz'; [EMAIL PROTECTED] Subject: Re: [PHP] Htmlentities and Newlines

[PHP] htmlentities

2002-04-06 Thread Joerg Hanke [ML-php]
hi! i've got the following problem and hope one of you is able to help me solving that: i've got a system in php that writes data (e.g. variable-name = $data) to a mysql database. there are two more scripts: one for displaying the data and one for writing the data into a formular. the

Re: [PHP] htmlentities

2002-04-06 Thread Jason Wong
On Saturday 06 April 2002 18:34, Joerg Hanke [ML-php] wrote: hi! i've got the following problem and hope one of you is able to help me solving that: i've got a system in php that writes data (e.g. variable-name = $data) to a mysql database. there are two more scripts: one for displaying