<?php if (!isSet($AdminLogin)) { header ("Location: index.php?err=1"); exit; } else { $conn = pg_Connect ("","","",$dbname); $chk = pg_Exec ($conn, "select * from $prefix"._admins." where login='$AdminLogin' and pass='$AdminPass'"); $chr = pg_NumRows($chk); if ($chr != 0) { setcookie ("AdminLogin", $AdminLogin,time()+$cooktime,$cookdomain); setcookie ("AdminPass", $AdminPass,time()+$cooktime,$cookdomain); $chk_obj = pg_Fetch_Object($chk, 0); } else { header ("Location: index.php?err=1"); exit; } } pg_close ($conn); ?>