dam wam zawartość plików w których jest logowanie:
index.php:
Kod
<html>
<head>
<title>Emulation</title>
<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=windows-1250">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<META NAME="DESCRIPTION" CONTENT="Opis strony">
<META NAME="KEYWORDS" CONTENT="slowa, kluczowe">
<link rel="StyleSheet" type="text/css" href="style.css">
</head>
<body bgcolor="#ffffff" background=gfx/bg.jpg topmargin="25" leftmargin="24" bottommargin="0">
<center>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="688" HEIGHT="338"><TR>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="172" HEIGHT="112" background=gfx/up_1x1.jpg></TD>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="172" HEIGHT="112" background=gfx/up_1x2.jpg></TD>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="172" HEIGHT="112" background=gfx/up_1x3.jpg></TD>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="172" HEIGHT="112" background=gfx/up_1x4.jpg></TD>
</TR><TR>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="172" HEIGHT="113" background=gfx/up_2x1.jpg></TD>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="172" HEIGHT="113" background=gfx/up_2x2.jpg></TD>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="172" HEIGHT="113" background=gfx/up_2x3.jpg></TD>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="172" HEIGHT="113" background=gfx/up_2x4.jpg></TD>
</TR><TR>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="172" HEIGHT="113" background=gfx/up_3x1.jpg></TD>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="172" HEIGHT="113" background=gfx/up_3x2.jpg></TD>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="172" HEIGHT="113" background=gfx/up_3x3.jpg></TD>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="172" HEIGHT="113" background=gfx/up_3x4.jpg></TD>
</TR></TABLE>
<table border=0 cellspacing=0 cellpadding=0 width=688 height=101>
<tr valign=top>
<td width=154 height=50 background=gfx/lgb.jpg></td>
<td width=400 height=50 background=gfx/b.jpg>
<center>
<?
if((isset($login)) && (isset($haslo))) {
$plik = file("txt/users.txt");
$licz = count($plik);
for($i=0; $i<=$licz; $i++) {
$xhaslo = md5($haslo);
$user = explode("|XxX/|", $plik[$i]);
if(($login==$user[0]) && ($xhaslo==$user[1])) {
print("Login: $login<br>Multimedia: Aktiwejt;]<br>Komentarze: Aktiwejt;]<br>"); // wiadomość jeśli user jest zalogowany
}
}
} else {
print("<form action="index.php?x=login" method=post>
Login: <input type=text name=login>
Hasło: <input type=text name=haslo>
<input type=submit value=OK><BR>
Nie masz konta?! <a href="index.php?x=add">Zarejestruj się!</a>
</form>"); //tutaj forma wyświetlam
}
?></center>
</td>
<td width=134 height=50 background=gfx/pgb.jpg></td>
</tr><tr valign=top>
<td width=154 height=51 background=gfx/ldb.jpg></td>
<td width=400 height=51 background=gfx/db.jpg></td>
<td width=134 height=51 background=gfx/pdb.jpg></td>
</tr><tr valign=top>
<td width=154 height=64 background=gfx/lpm.jpg></td>
<td width=400 height=64 background=gfx/spm.jpg></td>
<td width=134 height=64 background=gfx/ppm.jpg></td>
</tr></table>
<table border=0 cellspacing=0 cellpadding=0 width=688 background=gfx/bg1.jpg>
<tr valign=top><td width=35></td>
<td width=209>
<? require("txt/menu.emu"); ?>
</td>
<td width=7></td>
<td width=410>
<?
if($x==""){
$x = "news/pokaz";
}
if(file_exists("txt/$x.php")) {
include("txt/$x.php");
} else {
print("Brak strony do wyświetlenia");
}
?>
</td>
<td width=27></td>
</tr></table>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="688" HEIGHT="144"><TR>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="229" HEIGHT="48" background=gfx/down_1x1.jpg></TD>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="230" HEIGHT="48" background=gfx/down_1x2.jpg></TD>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="229" HEIGHT="48" background=gfx/down_1x3.jpg></TD>
</TR><TR>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="229" HEIGHT="48" background=gfx/down_2x1.jpg></TD>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="230" HEIGHT="48" background=gfx/down_2x2.jpg></TD>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="229" HEIGHT="48" background=gfx/down_2x3.jpg></TD>
</TR><TR>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="229" HEIGHT="48" background=gfx/down_3x1.jpg></TD>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="230" HEIGHT="48" background=gfx/down_3x2.jpg></TD>
<TD ROWSPAN="1" COLSPAN="1" WIDTH="229" HEIGHT="48" background=gfx/down_3x3.jpg></TD>
</TR></TABLE>
</center>
</body>
</html>
login.php (w adresie jest to odniesione index.php?x=login):
Kod
<?
if(($login=="") && ($haslo=="")) {
print("Niepodałeś loginu lub/i hasła!");
exit();
}
if((isset($login)) && (isset($haslo))) {
$licz = count(file("txt/users.txt"));
$plik = file("txt/users.txt");
for($i=0; $i<=$licz; $i++) {
$xhaslo = md5($haslo);
$user = explode("|XxX/|", $plik[$i]);
if(($login==$user[0]) && ($xhaslo==$user[1])) {
setcookie("haslo", $haslo, time()+3600);
setcookie("login", $login, time()+3600);
$loged = TRUE;
}
}
}
if ($loged) {
print("Zalogowałeś się!");
} else {
print("Złe haslo/login");
}
?>
to wszystko
mam nadzieje że znajdziecie gdzie zrobiłem błąd (jeśli owy zrobiłem) i mi pomożecie
zastosowanie mozecie znaleźć na stronie
www.emunation.glt.pl