0 || strtolower($_GET['id']) == "admin") { // Lapa // Parbauda vai logoshanas sesija ir ok, vai ari logojas ara if(((int)$_SESSION['je_admin_id'] > 0 && $_SESSION['je_admin_ip'] != $_SERVER['REMOTE_ADDR']) || (strtolower($_GET['id']) == "admin" && strtolower($_GET['sid']) == "logout")) { session_destroy(); }; // Parbauda, vai logojas ieksa if(strtolower($_GET['id']) == "admin") { if (isset($_POST['login'])) { $username=strtolower($_POST['login_username']); $password=$_POST['login_password']; $password = str_replace("<", "", $password); $password = str_replace(">", "", $password); $password = str_replace('"', "", $password); $password = str_replace("'", "", $password); $password = sha1($password); $password = md5($password); if ($password=='') {} else{ $query = 'Select id, field2 From config Where tips = "admin" AND field1 = "'.$username.'"'; $result = mysql_query($query); $data = mysql_fetch_assoc($result); if($data['field2'] == $password) { $_SESSION['je_admin_id'] = $data['id']; $_SESSION['je_admin_ip'] = $_SERVER['REMOTE_ADDR']; }; }; }; }; include('content/engine.php'); } else { // Sākums include('content/sakums.php'); }; ?>