Kod: Zaznacz cały
Notice: Undefined variable: pass in C:\Program Files\Apache Group\Apache2\htdocs\rejestracja\log_proc.php on line 17
zle dane
regist_dane.php
Kod: Zaznacz cały
<html>
<head>
<title>Rejestracja</title>
<center>
<body bgcolor="black" font color="white">
<form action="regist_proc.php" method="post">
<font color="white">LOGIN*: </font><input type="text" name="login_add"><br>
<font color="white">HASLO*: </font><input type="password" name="pass_add"><br>
<font color="white">Wiek*: </font><input type="text" name="wiek_add" ><br>
<font color="white">GG: </font><input type="text" name="gg_add" ><br>
<font color="white">E-mail*: </font> <input align="center" type="text" name="email_add"><br><br>
<font color="white">INFO: </font> <br><textarea rows="5" cols="50" name="info_add">Tutaj znajdowac moga sie, np: zainteresowania, miasto itp.</textarea><br>
<input type="reset" value="Wyczysc"><input type="submit" value="Register"></form>
<br><br>
<font color="white">Pola oznaczone "<b>*</b>" sa obowiazkowe !!</font>
</center>
</body>
</head>
</html>Kod: Zaznacz cały
<html>
<head>
<title>Rejestracja</title>
<center>
<body bgcolor="black">
<font color="white">
<?php
$login_add = $_POST['login_add']; //*
$pass_add = $_POST['pass_add']; //*
$wiek_add = $_POST['wiek_add']; //*
$gg_add = $_POST['gg_add'];
$email_add = $_POST['email_add']; //*
$info_add = $_POST['info_add'];
$str_login = strlen($login_add);
$str_pass = strlen($pass_add);
$str_wiek = strlen($wiek_add);
$str_gg = strlen($gg_add);
$str_email = strlen($email_add);
$str_info = strlen($info_add);
$file = ("users/$login_add.php");
if(file_exists($file)):
echo ("Taki login juz istnieje...");
elseif (($str_login == 0) || ($str_pass == 0) || ($str_wiek == 0) || ($str_email == 0)):
echo ("Nie wypelniles pol zaznaczonych * !!");
elseif (!file_exists($file)):
$ciag = "<?\n\$login = \"$login_add\";\n\$pass = \"$pass_add\";\n\$email= \"$email_add\";\n ?> ";
$zapis = str_replace("$ "," $",$ciag);
$open = fopen("$file","w+");
fputs($open,"$zapis");
fclose($open);
echo ("Zarejestrowany zostales pomyslnie!");
else:
echo ("zle dane !");
endif;
?>
</body>
</head>
</html>Kod: Zaznacz cały
<html>
<head>
<title>Logowanie</title>
<center>
<body bgcolor="black" font color="white">
<form action="log_proc.php" method="post">
<font color="white">LOGIN*: </font><input type="text" name="login_check"><br>
<font color="white">HASLO*: </font><input type="password" name="pass_check"><br>
<input type="reset" value="Wyczysc"><input type="submit" value="Loguj"></form>
<br><br>
</center>
</body>
</head>
</html>Kod: Zaznacz cały
<html>
<head>
<title>Logowanie</title>
<center>
<?php
$login_check = $_POST['login_check'];
$pass_check = $_POST['pass_check'];
$file = ("users/$login_check.php");
if (!file_exists($file)):
echo('Podales zly login');
elseif (file_exists($file)):
include($file);
if($pass==$pass_check):
echo ("zalogowany jestes!");
else:
echo("zle dane");
endif;
endif;
?>
</center>
</body>
</head>
</html>

