<?php
$inputednn = $_POST['inpunn'];
$inputedpass = $_POST['inpupass'];
include "mysql.php";
$db_selected = mysql_select_db('db_lentele', $connect) or die("Nerandu duombazes");

$get = mysql_query("SELECT * FROM vartotojai");

while ($rows = mysql_fetch_assoc($get))
{
		$dbnn = $rows['username'];
		$dbpass = $rows['password'];
}

if ($inputednn == "")
{
die ("Neyrasytas VartotojoID <a href='index.php'>Atgal</a>");
}
elseif ($inputedpass == "")
{
die ("Neyrasytas Slaptazodis <a href='index.php'>Atgal</a>");
}
elseif ($inputedpass != $dbpass||$inputednn != $dbnn)
{
die ("Neteisingi prisijungimo duomenys <a href='index.php'>Atgal</a>");
}
elseif ($inputedpass = $dbpass||$inputednn = $dbnn)
{
$_SESSION['prisijunges'] = true;
echo '<meta http-equiv="refresh" content="0;url=index.php">';
/*
$sesija = $_SESSION['pavadinimas'];
if(isset($sesija)) { echo "bla"; }
if($sesija = true) { echo "bla"; }
//Jei duomenys yrasyti ir jai jie tinka */
}
?>