<?php session_start(); require path . 'common/UserLog.php'; require path . 'common/smarty.php'; //$username = $_POST['username']; //$password = $_POST['password']; //$code = $_POST['code']; $username = '******'; $password = '******'; $code = '123456'; $login = new UserLog(); $islogin = $login->login($username, $password, $code); if ($islogin) { $_SESSION['islogin'] = true; $smarty->assign('login', 'succes'); $smarty->display('login.tpl'); } else { $smarty->assign('login', 'failed'); $smarty->display('login.tpl'); }