Alfraganus Posted December 20, 2015 Share Posted December 20, 2015 (edited) my datas are not being shown properly, but I have declared charset=utf-8, i dont know what is wrong with it, but charset is not wroking <?php header('Content-Type: text/html; charset=UTF-8'); ?> <!DOCTYPE html> <html> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <link rel="stylesheet" href="style.css" media="all" /> </head> <link rel="stylesheet" type="text/css" href="style.css"> <body> <div id="header">ajshcoljwq qwpdjpqwkdqokdwpqodk'pqw </div> <div id="sidebar"> </div> <center> <div id="content"> <?php $con=new mysqli("localhost","root","", "testdb"); $sql="SELECT * FROM cms"; $run=mysqli_query($con, $sql); while($row=mysqli_fetch_array($run)) { $title=$row['title']; $body=$row['body']; } echo " <h1> $title</h1 <p>$body</p> "; ?> <div id="footer"> </center> </body> </html> Edited December 20, 2015 by Alfraganus Link to comment Share on other sites More sharing options...
davej Posted December 20, 2015 Share Posted December 20, 2015 That looks a little messed up, but are you also saving the Php file in UTF-8 format? Link to comment Share on other sites More sharing options...
Alfraganus Posted December 20, 2015 Author Share Posted December 20, 2015 yes and it is not working, do you have any suggestion? Link to comment Share on other sites More sharing options...
davej Posted December 20, 2015 Share Posted December 20, 2015 Try something simpler... <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>t</title> </head> <body> <p>Put some foreign characters here ... </p> </body> </html> Link to comment Share on other sites More sharing options...
Alfraganus Posted December 20, 2015 Author Share Posted December 20, 2015 did not work at all(((( Link to comment Share on other sites More sharing options...
davej Posted December 20, 2015 Share Posted December 20, 2015 If that did not work then your file is not UTF-8. Link to comment Share on other sites More sharing options...
Alfraganus Posted December 20, 2015 Author Share Posted December 20, 2015 how can I identify my file's format can deal with it? Link to comment Share on other sites More sharing options...
davej Posted December 20, 2015 Share Posted December 20, 2015 You could download a text-editor that is known to support UTF-8. Look at Vim or Notepad++. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now