template_dir = 'template/templates'; $smarty->compile_dir = 'template/templates_c'; $smarty->cache_dir = 'template/cache'; $smarty->config_dir = 'template/configurari'; $tip=$segment[0]; $idp=$segment[1]; $dir=$config_site_url; if ($_SESSION['login']<1) { if ($_POST['step']=='auth') { if (strlen($_POST['utilizator'])>5 and strlen($_POST['parola'])>5) { $rez=mysql_query("SELECT * FROM utilizatori where LOWER(username)='".strtolower(mysql_real_escape_string($_POST['utilizator']))."' and parola='".md5(mysql_real_escape_string($_POST['parola']))."' LIMIT 1"); if (mysql_num_rows($rez)) $_SESSION['login']=mysql_result($rez,0,'id'); else $eroare='Utilizator sau parola invalide
'; } else $eroare='Utilizator sau parola invalide
'; } $continut.='

Autentificare

'.$eroare.'
'; } $smarty->assign('continut', $continut); $smarty->assign('dir', $dir); if ($_SESSION['login']<1) $smarty->display('index.html'); else $smarty->display('index2.html'); ?>