Parašė sidicer· 2010 Rugp. 18 21:08:21
#3
<?php
//
MySQL Connect
$con = mysql_connect("host","user","pass") or die("Neprisijungiu prie
MySQL");
mysql_select_db("name") or die("Nerandu duomenu bazes");
//
if ($_POST['sub'])
{
//
echo '<td class="juosta3">';
//
$inputnick = $_POST['nick'];
$inputpass = $_POST['pass'];
$mdpass = md5($inputpass);
$getdata = mysql_query("SELECT * FROM users");
while($rows = mysql_fetch_assoc($getdata))
{
$datanick = $rows['nick'];
$datapass = $rows['pass'];
}
if ($inputnick == "" || $inputpass == "")
{
echo "Laukeliai tusti";
}
elseif ($datanick != $inputnick || $datapass != $mdpass)
{
echo "Slapyvardis arba Slaptazodis blogi";
}
else
{
$laikas = time()+ 60*60*24;
setcookie("loged","$datanick",$laikas);
print Prisijungei;
}
//
echo '</td>';
//
}
?>