Re: PHP Problem, Special String Character...please help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You can encode string before sending it out.
Try htmlspecialchars($str, ENT_QUOTES).. before sending string

---------------------
from PHP manual:
The translations performed are:


  a.. '&' (ampersand) becomes '&'

  b.. '"' (double quote) becomes '"' when ENT_NOQUOTES is not set.

  c.. ''' (single quote) becomes ''' only when ENT_QUOTES is set.

  d.. '<' (less than) becomes '&lt;'

  e.. '>' (greater than) becomes '&gt;'

-------------

Hope this helps,

Muhammed Mamedov
tmchat.com


----- Original Message -----
From: "Ferry CS" <ferry21cs@xxxxxxxxxxx>
To: <pjln1@xxxxxxxxxxx>; <djpreach@xxxxxxxxxxx>; <php-db@xxxxxxxxxxxxx>
Sent: Wednesday, January 14, 2004 12:20 PM
Subject:  PHP Problem, Special String Character...please help


> Hai...
>
> I have problem with manipulating the string...
> How to send the string with special character
> included to the other pages...
>
> For example the string "Father & Son", when I send into
> other page the display become "Father"
> Example special characters are &, +, <, >, etc
>
>
> How to fix it???
> Thanks very much for your kind attention
>
> Best Regards,
> Ferry
>
>
> PHP sample
>
> file 1 : string_test.php
>
> <html>
> <?
> $title="Father & Son";
> echo "the real title : $title";
> ?>
>
> <br>
> <p><a href="string_display.php?stitle=<? echo $title;?>">next page</a></p>
>
> </html>
>
>
>
>
> file 2 : string_display.php
>
> <html>
> <?
> echo "in this page<br>";
> echo "the title : $stitle";
> ?>
> <p>Could you fix this problem??</p>
> <P>the title should be "Father & Son"<p>
> <p>the problem is using the special character ( &, +, ", <, >, etc)</p>
> <br>
> <p><a href="string_test.php">back</a></p>
>
> </html>
>
> _________________________________________________________________
> Add photos to your messages with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux