| | |
Display correctly Greek and special characters
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: May 2008
Posts: 31
Reputation:
Solved Threads: 0
I have a problem with my project.
The project search through the database and displays the results.
The problem is that I get question marks instead of GREEK letters (i do not mean rubbish, i mean Greek).
Suppose that the problem is not about encoding.
I have to find the command that displays the title of the product into the results page.
I finally found this :
I guess the problem is
Is there the right place to be?
Please get a view at http://gr2.php.net/htmlentities
I attach the file that includes the previous code.
Thank you
The project search through the database and displays the results.
The problem is that I get question marks instead of GREEK letters (i do not mean rubbish, i mean Greek).
Suppose that the problem is not about encoding.
I have to find the command that displays the title of the product into the results page.
I finally found this :
PHP Syntax (Toggle Plain Text)
$tplv['id']=$row['id']; $tplv['high']=$ISHIGHLIGHTED; $tplv['bold']=$ISBOLD; $tplv['idformat']="<A HREF=\"".$SETTINGS['siteurl']."item.php?id=".$row['id']."\">"; if($ISHIGHLIGHTED) { $tplv['idformat'] .= "<SPAN CLASS=hg>"; } if($ISBOLD) { $tplv['idformat'] .= "<B>"; } $tplv['idformat'] .= stripslashes(htmlspecialchars($row['title'])); if($ISBOLD) { $tplv['idformat'] .= "</B>"; } if($ISHIGHLIGHTED) { $tplv['idformat'] .= "</SPAN>"; } $tplv['idformat'].= "</FONT></A>";
I guess the problem is
PHP Syntax (Toggle Plain Text)
$tplv['idformat'] .= stripslashes(htmlspecialchars($row['title']));
Is there the right place to be?
Please get a view at http://gr2.php.net/htmlentities
I attach the file that includes the previous code.
Thank you
•
•
Join Date: May 2008
Posts: 31
Reputation:
Solved Threads: 0
The problem is not the database. I do import it with utf8 and all pages are utf8 encoded plus i used the meta charset tag.
The problem is with one single line
$tplv['idformat'].= stripslashes(htmlspecialchars($row['title']));
and changed it to
$tplv['idformat'].= stripslashes(htmlspecialchars($row['title'], ENT_COMPAT, "UTF-8"));
but again nothing happens.
Also, when i edit a page(e.g. my welcome page) where i write greek letters, it displayed correctly.
If i edit it again , my greek letters (only in editing mode) are written like
& # and three numbers, all without spaces.
The problem is with one single line
$tplv['idformat'].= stripslashes(htmlspecialchars($row['title']));
and changed it to
$tplv['idformat'].= stripslashes(htmlspecialchars($row['title'], ENT_COMPAT, "UTF-8"));
but again nothing happens.
Also, when i edit a page(e.g. my welcome page) where i write greek letters, it displayed correctly.
If i edit it again , my greek letters (only in editing mode) are written like
& # and three numbers, all without spaces.
![]() |
Other Threads in the PHP Forum
- Previous Thread: Setting a width to a photo displayed from MySQL doesnt work
- Next Thread: Text based mafia game
| Thread Tools | Search this Thread |
.htaccess action ajax apache api array auto beginner binary bounce broken cakephp checkbox class cms code cron curl database date display dynamic echo email error errorlog file files folder form format forms function functions google href htaccess html image include insert integration interactive ip java javascript joomla limit link login loop mail malfunctioning masterthesis menu mlm mod_rewrite multiple mysql nodes oop paypal pdf php popup problem query radio ram random recursion reference regex remote return script search server sessions sms soap source space sql syntax system table tutorial unset update upload url validation validator variable video web websitecontactform xml youtube





