sestais Posted July 26, 2009 Report Share Posted July 26, 2009 Sveiki! Man tāda problēma ka mājas lapa nerāda latviešu burtus citos lodziņos! 1)Kad es pievienoju kaut ko jaunu ar latviešu burtiem man izskatas kaut kas šitā. 2)PhpMyadmin. 3)Mani skripti. 3.1)Pievienošanas skripts. <link rel="stylesheet" type="text/css" href="Style/addeditdelete.css"><script type="text/javascript" src="BBCodes/BBCodes.js"></script> <div class='add'> <?php include_once "config/MysqlConnect.php"; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); mysql_select_db($dbname); if(!$_POST['add']){ echo "<center>\n"; echo "<form method=\"post\">\n"; echo "<input type=\"hidden\" name=\"id\" >\n"; echo "<table border=\"0\" width=\"100%\" style=\"border-style: solid; border-width: 1px; padding-left: 4px; padding-right: 4px; padding-top: 6px; padding-bottom: 6px\" cellspacing=\"2\" cellpadding=\"0\">\n"; echo "<tr><td align=\"right\">Name: </td><td width=\"814\">\n"; echo "<input type=\"text\" name=\"name\"></td></tr>\n"; echo "<tr><td align=\"right\"><br>Signature: </td><td><center><script>edToolbar('mytxtarea'); </script></center><textarea name=\"signature\" id=\"mytxtarea\" rows=\"10\" cols=\"60\"></textarea></td></tr>\n"; echo "<tr><td align=\"right\">\n"; echo "<p align=\"center\"> </td><td align=\"center\">\n"; echo "<input type=\"submit\" name=\"add\" value=\"-Pievienot-\"></td></tr>\n"; echo "</table> </form>\n"; echo "</center>\n"; }else { $name = $_POST['name']; $sign = $_POST['signature']; $daten = date("d.m.Y"); $time = (date(" H:i")); $date = "$daten $time"; $errors = array(); $sql = "INSERT INTO `news`(`name`,`signature`,`date`) VALUES ('".$name."','".$sign."','".$date."')"; $res = mysql_query($sql) or die(mysql_error()); echo "Veiksmīgi pievienots!<br />"; } ?> </div> 3.2) Skripts kas parada pievienoto. <html xmlns="http://www.w3.org/1999/xhtml"><head> <meta http-equiv="Content-Language" content="lv"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link rel="stylesheet" type="text/css" href="admin/Style/style.css"> <link rel="stylesheet" type="text/css" href="admin/Style/paginator.css"> </head> <center> <body onload="setupZoom()"> <div class="pagination"> <?php include "./admin/config/MysqlConnect.php"; require_once './admin/BBCodes/BBCode.php'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); mysql_select_db($dbname); mysql_query("set names charset=utf8"); mysql_query("set charset set charset=utf8"); $page = (!$_GET['page'] || $_GET['page'] < 0) ? "1" : $_GET['page']; $page = ceil($page); $limit = 5; $start = $limit; $end = $page*$limit-($limit); $amount_check = "SELECT * FROM `news`"; $amount_check_res = mysql_query($amount_check) or die(mysql_error()); $amount_count = mysql_num_rows($amount_check_res); $pages = ceil($amount_count/$limit); $previous = ($page-1 < 1) ? "" : "<a href=\"./index.php?act=news&id=".$id."&page=".($page-1)."\" >«</a>"; $nextpage = ($page+1 > $pages) ? "" : "<a href=\"./index.php?act=news&id=".$id."&page=".($page+1)."\">»</a>"; ?> </div> <?php $select_sql = "SELECT * FROM `news` ORDER BY id desc LIMIT ".$end.",".$start.""; $select_res = mysql_query($select_sql) or die(mysql_error()); while($row = mysql_fetch_assoc($select_res)){ $name = ($row['name']); $sig = ($row['signature']); $date = ($row['date']); $bb = new parse(); $text = $bb->parseBB ($sig); echo "<center>\n"; echo "<table cellpadding=\"0\" cellspacing=\"0\" width=\"596\" height=\"253\">\n"; echo " <tr>\n"; echo " <td valign=\"middle\" background=\"images/FormBox top.png\" colspan=\"3\" height=\"51\">\n"; echo " <div align=\"center\">\n"; echo " <table cellpadding=\"0\" cellspacing=\"0\" width=\"483\" height=\"37\">\n"; echo " <tr>\n"; echo " <td width=\"483\" height=\"40\" valign=\"bottom\"><b><font size=\"5\">\n"; echo " <p align=\"center\">".$name."</font></b></td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </div>\n"; echo " </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td valign=\"top\" background=\"images/FormBox left.png\" width=\"12\">\n"; echo " </td>\n"; echo " <td width=\"570\" valign=\"top\" background=\"images/botom.png\">\n"; echo " <div align=\"center\">\n"; echo " <table cellpadding=\"0\" cellspacing=\"0\" width=\"542\" height=\"165\">\n"; echo " <tr>\n"; echo " <td width=\"542\" height=\"165\" valign=\"top\"><font size=\"3\" face=\"Calibri\">".$text."</font></td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </div>\n"; echo " </td>\n"; echo " <td valign=\"top\" background=\"images/FormBox right.png\" height=\"168\" width=\"14\">\n"; echo " </td>\n"; echo " </tr>\n"; echo " <tr>\n"; echo " <td valign=\"middle\" background=\"images/FormBox bottom.png\" colspan=\"3\" height=\"34\">\n"; echo " <div align=\"center\">\n"; echo " <table cellpadding=\"0\" cellspacing=\"0\" width=\"543\" height=\"19\">\n"; echo " <tr>\n"; echo " <td width=\"543\" height=\"19\"><b><font face=\"Arial\">".$date."</font></b></td>\n"; echo " </tr>\n"; echo " </table>\n"; echo " </div>\n"; echo " </td>\n"; echo " </tr>\n"; echo "</table>\n"; echo "</center>\n"; } ?> <div class="pagination"> <table cellpadding="0" cellspacing="0" width="440" height="23"> <tr> <td width="440" height="6"></td> </tr> <tr> <td width="440" height="20" valign="middle"> <p align="center"> <?php echo $previous; for($i=1;$i<=$pages;$i++){ $href = ($page == $i) ? "<span style=\"padding: 4px 6px 4px 6px;margin-right: 3px;background-color: #88AF3F;color: #FFFFFF;font-weight: bold;\">".$i."</span>" : "<a href=\"./index.php?act=news&id=".$id."&page=".$i."\">".$i."</a>"; echo $href; } echo $nextpage; ?> </p> </td> </tr> </table> </div> </body> </center> </br> </html> Lūdzu palidziet atrisināt šo problemu ja kaut kas vel vajadzigs sakiet!!! Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted July 26, 2009 Report Share Posted July 26, 2009 Skriptā: ./admin/config/MysqlConnect.php ieliec rindiņu, lai izpilda šādu MySQL pieprasījumu: SET NEAMES utf8 Quote Link to comment Share on other sites More sharing options...
sestais Posted July 26, 2009 Author Report Share Posted July 26, 2009 Skriptā: ./admin/config/MysqlConnect.php ieliec rindiņu, lai izpilda šādu MySQL pieprasījumu: SET NEAMES utf8 Es ieliku mysql_query("SET NAMES 'utf8'"); taja faila bet man vel slikta parveršas! Quote Link to comment Share on other sites More sharing options...
tas_pats Posted July 26, 2009 Report Share Posted July 26, 2009 <head> blokā ievieto: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> pārliecinies vai pats fails ir utf-8 kodējumā. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.