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.
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:
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
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,
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
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),
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
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
-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
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
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');
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
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
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
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
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
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!
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
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
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
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
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
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
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
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
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
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
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().
--- 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
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
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
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.
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
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
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
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
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
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
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
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
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 =
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
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
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
: 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
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
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
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
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,
-
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
?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
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
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
-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
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
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
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
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
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
-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
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
-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
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
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
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
65 matches
Mail list logo