include "functions.php"; $lastlogintime = time()-60*15; $del=mysql_query("DELETE FROM `users_logedin` WHERE `Timestamp` < '$lastlogintime' "); if($REQUEST_METHOD=="POST"){ $result=mysql_query("select * from `users` where `UserName`='$username' AND `Password`='$password'"); $nr=mysql_num_rows($result); $data=mysql_fetch_array($result); if($nr!=0 && $data['UserName'] === $_POST['username'] && $data['Password'] === $_POST['password'] ){ if($data[AccesDenied]=="y") { echo " "; } else { $login[1]=$username; $login[2]=$data[LastLogin]; session_register("login"); $today_now = strtotime('now'); $ins=mysql_query("insert into `users_logedin` values('','$login[1]','$today_now');"); $most=date("d. m Y, H:i:s"); $query=mysql_query("update `users` set `LastLogin`='$most' where `UserName`='$username'"); } } else{ echo " "; } } $is_logedin=mysql_num_rows(mysql_query("select * from `users_logedin` where `User`='$login[1]'")); if(!session_is_registered("login") || $is_logedin<=0) { $result =mysql_query("SELECT * FROM `pagetitle`"); $data = mysql_fetch_array($result); $tit = $data[Title]; $result =mysql_query("SELECT * FROM `google`"); $data = mysql_fetch_array($result); $most = date("d-m-Y"); //if( ($most>="17-12-2007" && $most<="31-12-2007") || $most=="01-01-2008") { // $onl = "window.open('lit_banner.php','_window','status=no,top=20,left=20,width=550,height=350,location=no,titlebar=no,menubar=no,toolbar=no')"; //} //else { $onl = ""; //} echo " $tit

Bine ati venit pe BearingNet.ro!
"; mysql_query("set names utf8"); $data=mysql_fetch_array(mysql_query("select * from `about`")); echo " $data[Description]

[ MEMBRII ] [ MAI DEPARTE ]
"; $data=mysql_fetch_array(mysql_query("select * from `contact`")); //$data[Description]=str_replace("@","",$data[Description]); echo " $data[Description]
Va rugam introduceti numele utilizator si parola pentru a va loga.
Nume utilizator:
Parola:
"; } else { if($is_logedin>0) { //header ("location: search.php"); echo ""; } } ?>