Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Problem z kodowanie znaków
Forum PHP.pl > Forum > Gotowe rozwiązania
Paluch
Chce zrobić forum. Mam do dyspozycji serwer z php lecz bez MySQL. Znalazłem bardzo fajne forum - UPB. Niestety jest ono po angielsku i nigdzie nie znazlem spolszczenia. Postawnowilem więc to zrobić sam. Niestety dopiero sie ucze php. Spolszczenie mi jakoś idzie, ale nie moge sobie poradzić z kodowanie znakow aby byly polskie znaki ąćęź itp. Ponizej przedstawiam kod php pliku register.php mysle ze jesli powiecie mi jak zrobić to z jednym plikiem z innymi juz sam to zrobie:

[php:1:8df6cef813]<?php
<?
// Ultimate php Board Register
include "func.inc.php";
$where = "<b>></b> Register";
if(!isset($submit))
{
$submit = "";
}
if($submit == "Submit") {


$u_login = strip_tags($u_login);
$u_login = trim($u_login);
//$u_login = addslashes($u_login);

if($u_pass == '' || $u_pass2 == '' || $u_login == '' || $u_email == '') {
include "header.php";
print "Nie wypełniłeś wszystkich wymaganych pól! (*)";
include "footer.php";
exit;
}

$d = listall("./db/users");
$c = count($d)-2;
for($i=0; $i<=$c; $i++) {
$r = def($d[$i], "./db/users");
if($u_login == $r[user_name]) {
include "header.php";
print "Nazwa użytkownika jest już w użyciu!";
include "footer.php";
exit;
}
}

if($u_pass != $u_pass2) {
include "header.php";
print "Twoje hasło i potwierdzenie hasła się nie zgadzają!";
include "footer.php";
exit;
}

if(strlen($u_pass) < 4)
{
include "header.php";
print "Hasło musi zawierać co najmniej 4 znaki";
include "footer.php";
exit;
}

if (!eregi("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*$", $u_email)) {
include "header.php";
print "Wprowadź poprawny adres e-mail!";
include "footer.php";
exit;
}


$u_sig = chop($u_sig);
$pass = md5($u_pass);

if(substr(trim(strtolower($u_site)), 0, 7) != "http://") {
$u_site = "http://" . $u_site;
}
include "header.php";
add("$u_login<~>$pass<~>1<~>$u_email<~>$u_loca<~>$u_site<~>$u_icq<~>$u_aim<~>$u_msn<~>$u_sig<~>0<~>".date("Y-m-d"), "./db/users", "no");

$register_msg = str_replace("<login>", $u_login, $register_msg);
$register_msg = str_replace("<password>", $u_pass, $register_msg);
if(!@mail($u_email, $register_sbj, $register_msg, "From: $admin_email"))
{
error_log ("Unable to send register email conformation to user: $u_login", 3, "./logs/error.log");
}
print "Jesteś teraz zarejestrowany!<BR><BR>Możesz się teraz zalogować i postować";
echo "<meta http-equiv='refresh' content='2;URL=login.php?ref=index.php'>";
include "footer.php";

} else {

include "header.php";

if(isset($id_env)) {
echo "You already logged in.";
} else {
echo "<form action='register.php' method=POST>
<center><table width=$table_width_main cellspacing=1 cellpadding=3 border=0 bgcolor='$border'>
<tr><td colspan='2' bgcolor='$header'><B><font size='$font_l' face='$font_face' color='$font_color_header'>Register <font size='$font_s'>(note: required fields are marked with a <font color=red>*</font>)</font></font></b></td></tr>
<tr><td bgcolor='$table1'><font size='$font_m' face='$font_face' color='$font_color_main'><font color=red>*</font> Użytkownik:<br><font size='$font_s'>Użyty login będzie twoim identyfikatorem na Forum</font></font></td><td bgcolor='$table1' width=10%><input type=text name=u_login size=40></td></tr>
<tr><td bgcolor='$table1'><font size='$font_m' face='$font_face' color='$font_color_main'><font color=red>*</font> Hasło:</font></td><td bgcolor='$table1'><input type=password name=u_pass size=40></td></tr>
<tr><td bgcolor='$table1'><font size='$font_m' face='$font_face' color='$font_color_main'><font color=red>*</font> Potwierdź hasło:</font></td><td bgcolor='$table1'><input type=password name=u_pass2 size=40></td></tr>
<tr><td bgcolor='$table1'><font size='$font_m' face='$font_face' color='$font_color_main'><font color=red>*</font> Adres e-mail:<br><font size='$font_s'>Musisz wprowadzić prawidłowy adres (twojeimię@host.com) - na ten adres otrzymasz potwierdzenie rejestracji</font></font></td><td bgcolor='$table1'><input type=text name=u_email size=40></td></tr>
<tr><td bgcolor='$table1'><font size='$font_m' face='$font_face' color='$font_color_main'>Lokalizacja:<br><font size='$font_s'>Skąd jesteś? (it can be anything)</font></font></td><td bgcolor='$table1'><input type=text name=u_loca size=40></td></tr>
<tr><td bgcolor='$table1'><font size='$font_m' face='$font_face' color='$font_color_main'>Strona WWW:<br><font size='$font_s'>Proszę użyj http:// na początku adresu url</font></font></td><td bgcolor='$table1'><input type=text name=u_site size=40></td></tr>
<tr><td bgcolor='$table1'><font size='$font_m' face='$font_face' color='$font_color_main'>ICQ:<br><font size='$font_s'>Jeżeli masz ICQ - tutaj wprowadź swój numer</font></font></td><td bgcolor='$table1'><input type=text name=u_icq size=40></td></tr>
<tr><td bgcolor='$table1'><font size='$font_m' face='$font_face' color='$font_color_main'>AIM:<br><font size='$font_s'></font></font></td><td bgcolor='$table1'><input type=text name=u_aim size=40></td></tr>
<tr><td bgcolor='$table1'><font size='$font_m' face='$font_face' color='$font_color_main'>MSN:<br><font size='$font_s'></font></font></td><td bgcolor='$table1'><input type=text name=u_msn size=40></td></tr>
<tr><td bgcolor='$table1'><font size='$font_m' face='$font_face' color='$font_color_main'>Sygnaturka:<br><font size='$font_s'>Twoja sygantura będzie dołączana do każdej Twojej wiadomości na Forum</font></font></td><td bgcolor='$table1'><textarea name=u_sig cols=45 rows=10></textarea></td></tr>
<tr><td bgcolor='$table1' colspan=2><input type=submit name=WYŚLIJ value='Submit'></td></tr>
</table></form>";
}

include "footer.php";

}

?>
?>[/php:1:8df6cef813]


Podpowiedzcie mi co gdzie mam wstawić. Jestem początkującym. Z góry dziękuje z odpowiedz. Pozdrawiam!
Wankster
no może na stronie ustawić polskie kodowanie??
Paluch
Jak to ustawić na stronie polskie kodowanie? Sorki, ale nie kapuje. To ma być samo forum bez żadnej innej strony. Proszę o jaśniejsz wytłumaczenie.
Paluch
Możecie mi odpowiedziec. To dla mnie ważna. Wiem już ze musze wstawić
[php:1:00561da146]
<HEAD>
<META HTTP-EQUIV="content-type"
CONTENT="text/html; charset=Windows-1250">
</HEAD>[/php:1:00561da146]

Jak to wstawie na samą górę kodu to pokazuje czcionkę oki tylko że jak uruchamiam juz ten skrypt to na samej górze mam taki błąd:

Warning: Cannot modify header information - headers already sent by (output started at /home/e/e.poplawska/public_html/php/UPB/index.php:5) in /home/e/e.poplawska/public_html/php/UPB/header.php on line 59

Warning: Cannot modify header information - headers already sent by (output started at /home/e/e.poplawska/public_html/php/UPB/index.php:5) in /home/e/e.poplawska/public_html/php/UPB/header.php on line 60

Warning: Cannot modify header information - headers already sent by (output started at /home/e/e.poplawska/public_html/php/UPB/index.php:5) in /home/e/e.poplawska/public_html/php/UPB/header.php on line 62

Warning: Cannot modify header information - headers already sent by (output started at /home/e/e.poplawska/public_html/php/UPB/index.php:5) in /home/e/e.poplawska/public_html/php/UPB/header.php on line 63


Co z tym zrobić? W jakie miejsce mam wstawić te kodowanie żeby wszystko działało?. Bardzo proszę o odpowiedz.
Wankster
są tam gdziesz jakies pliki szablonów (tpl, themes, templates) questionmark.gif?
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2024 Invision Power Services, Inc.