<?php
// Logare
include 'config.php';
$login = $_POST['login'];
$pass = $_POST['pass'];

$form = <<<HTML

<h1>Вход</h1>
<br/>
 <i>{$lng['signin']} {$lng['signin-msg']}</i>
 <br /> <br />
<form action="" method="post">
  <table border="0">
<tr>
 <td><b>{$lng['signin-login']}</b></td>
 <td><input name="login" value="$name" size="25"></td>
</tr>
<tr>
 <td><b>{$lng['signin-pass']} </b></td>
 <td><input name="pass" type="password" value="$email" size="25"></td>
</tr>
<tr>
 <td><b></b></td>
 <td><input class="btn green" type="submit" name="send" value="{$lng['signin']}"></td>
</tr>
 </table>
 </form>
HTML;
 if ($loged == "true") {
 $form = "Sunteti deja logat <meta http-equiv=\"refresh\" content=\"0; url=http://100vs500.ru/user\">";
 }
if ($_POST['send'] == "") { include "sus.php"; echo $form; } else {
//////////////////////////////
$link = mysql_connect($baza['host'], $baza['user'], $baza['pass'])
or die("Could not connect : " . mysql_error());
mysql_select_db($baza['nume']) or die("Eroare!, nume baza de date incoreta");
$r = mysql_query("SELECT pass FROM utiliz WHERE login = '$login'");
//////////////////////////////
$array = mysql_fetch_assoc($r);
if ($array['pass'] == $pass) {
setcookie("login", $login);
setcookie("pass", "f3".md5($pass)."3bd");
include "sus.php";
echo "Logat cu succes! <meta http-equiv=\"refresh\" content=\"0; url=http://100vs500.ru/user\">";} else {include "sus.php"; echo "Logare incorecta!".$form;}
}
include "jos.php";
?>
