Page 1 of 1
Need help apostroph doesn't show up in the output.
Posted: Wed Mar 11, 2009 3:53 pm
by iosephos
hello i am using fckeditor in the website and i have the apostroph error it doesn't show up in the out i am using this code for it :
<? $allquery = "SELECT * FROM txtfixe WHERE id_txtfixe = 1 limit 1";
$allresult = mysql_query($allquery) or die("Error: " . mysql_error());
$num = mysql_num_rows( $allresult);
while ($author = mysql_fetch_array($allresult))
{
$txtfixe = htmlentities($author ["txtfixe"]);} ?>
the out put is :
<?=$txtfixe?>
can anyone help please ? most of the text in the web is in french lang and the apostroph doesnt show up , ex : l'école in the output its like this l'école .
any help please.
Re: Need help apostroph doesn't show up in the output.
Posted: Thu Mar 12, 2009 1:12 am
by Dummy 2
just add the \ (backslash) in front of the apostrophe
example
<?php
echo 'l\' apostrophe again\' somesthing ';
?>
However, If u are retreiving from database, It can be problem with ur database. May be u need unicode coding!
Re: Need help apostroph doesn't show up in the output.
Posted: Fri Mar 13, 2009 12:31 am
by iosephos
its didnt work my friend i did put this
$txtfixe = html_entity_decode($author ["txtfixe"]);
it shows me all the quote but not all the htmlentities...
Re: Need help apostroph doesn't show up in the output.
Posted: Fri Mar 13, 2009 12:42 am
by requinix
Somehow ENT_QUOTES was passed to an earlier call of htmlspecialchars or htmlentities.
Once you get the apostrophe back, call htmlentities. Yeah, it's weird, but it should work.
Or you could do a simple
search-and-replace on the original version, searching for "'" and replacing it with a '.
Re: Need help apostroph doesn't show up in the output.
Posted: Fri Mar 13, 2009 2:14 am
by iosephos
tasairis wrote:Somehow ENT_QUOTES was passed to an earlier call of htmlspecialchars or htmlentities.
Once you get the apostrophe back, call htmlentities. Yeah, it's weird, but it should work.
Or you could do a simple
search-and-replace on the original version, searching for "'" and replacing it with a '.
how shoul i call it back in this script :S it's so weird
Re: Need help apostroph doesn't show up in the output.
Posted: Fri Mar 13, 2009 3:12 pm
by iosephos
i fixed it
its not the php code
its the Encoding in the html page
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
it should be like this :
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />