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: http://www.php.
Is there a way to only change accented characters and not HTML (Example:
)
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. I am tryin
On Sat, Mar 14, 2009 at 12:18 AM, Lester Caine 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, all this wacky
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 input
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), fo
2009/3/13 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_t
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 enti
> 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 pa
> -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
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
{
I have a zillion of these things from converting stupid MS Word characters into
something that will,
Folks,
Why should htmlentities() use the default_charset for $charset with this
example, taken from ext/standard/tests/strings/htmlentities10.phpt?
The test script expects the output to be:
string(28) "‚†™Ÿ"
According to the PHP Manual, the htmlentities() syntax is:
string htmlentities ( str
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 functi
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 thes
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 funct
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
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 sendi
Ronald Wiplinger wrote:
I tried to understand htmlentities by putting this code into a test.php:
Test of evil input
";
$field2=htmlentities($field1,ENT_QUOTES,UTF-8);
echo "field2=$field2";
you are echo'ing the same field1 variable as before.
by your comments at the bottom of what you
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:
Test of evil input
";
$field2=htmlentities($field1,EN
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=Greater input and lower input
Greater input and lower input
A 'quote' is bold
A 'quote' is bold
I expected that it would give me in
I tried to understand htmlentities by putting this code into a test.php:
Test of evil input
";
$field2=htmlentities($field1,ENT_QUOTES,UTF-8);
echo "field2=$field2";
echo htmlentities($field1,ENT_QUOTES,UTF-8);
echo "";
$str = "A 'quote' is bold";
// Outputs: A 'quote' is bold
ec
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 characte
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,
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
trade
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 c
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
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 migh
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
htm
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 <, it prints out a < character instead of
thinking "OK here comes an HTML tag.
> Copied and pasted the following sample script from the php manual and this
> outputs:
>
> ...
> $str = "A 'quote' is bold";
> echo htmlentities($str);
>
> ?>
> ..
>
> // outputs: A 'quote' is bold
>
> 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:
>
> ...
> $str = "A 'quote' is bold";
> echo htmlentities($str);
>
> ?>
> ..
>
> // outputs: A 'quote' is bold
>
> Not sure why the I am still getting the tags and spaces after the call to
>
--- Anthony Ritter <[EMAIL PROTECTED]> wrote:
> Copied and pasted the following sample script from the php manual
> and this outputs:
>
> ...
> $str = "A 'quote' is bold";
> echo htmlentities($str);
>
> ?>
> ..
>
> // outputs: A 'quote' is bold
>
> Not sure why the I am sti
Copied and pasted the following sample script from the php manual and this
outputs:
...
bold";
echo htmlentities($str);
?>
..
// outputs: A 'quote' is bold
Not sure why the I am still getting the tags and spaces after the call to
htmlentities().
Thank you for any help.
TR
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:
Choices
the & is there to make sure the page validates. the problem is that
some browsers seem to be incorrectly translating this to:
[REQUEST_URI] => /popup.php?name=Choices&product_id=15
instead of:
[REQUEST_URI] => /popup.php?name=Choic
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 htmlspecialchars
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 htmlspecialchars
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 < and > signs, which d
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 < and > signs, which
destroys the html mark
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 th
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 pr
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 = str_replace($asciitable[chr(255)],
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]
> > Subj
> -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
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]
> > Subj
> -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
> 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 d
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,
> 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).
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] Htmlent
> > 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 behavio
> -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. Holm
> 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 p
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
> /* db access using postgresql - each row is displayed */
> ...
> {$myrow['request']}
> ...
> ?>
>
> Now unless I can do something like:
>
> 'nl2br({$myrow['request']}'
Try something like
echo ''.nl2br($myrow['request'].'';
Regards Sascha
--
PHP General Mailing List (http://www.php.net/)
ginal Message-
> 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
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. Someon
> 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 'htm
> 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'
t; > -Original Message-
> > From: Andre Dubuc [mailto:[EMAIL PROTECTED]]
> > Sent: 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
:[EMAIL PROTECTED]]
> Sent: 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
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 possib
> 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 th
nl2br() covertes newlines to tags (something a browser will render).
Andre Dubuc 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
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
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 display
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 displaying
66 matches
Mail list logo