$form .= "<a href='logout.php'>logout</a>"; $uname = $_SESSION['username']; } else { $form = "<input type='hidden' name='login'>"; $form .= "<input class='span2' type='text' name='username' placeholder='User name'>"; $form .= "<input class='span2' type='password' name='password' placeholder='Password'>"; $form .= "<input type='submit' name='submit' value='Login' class='btn'/>"; $form .= "</form>"; $form .= "<ul class='nav pull-right'>"; $form .= "<li><a href='register.php'>Registration</a></li>"; } include_once 'include/config.php'; include_once 'classes/conn.class.php'; if (isset($_POST['login'])) { $cmd = new Conn(); $cmd->login($_POST['username'], $_POST['password']); $location = $_SERVER['HTTP_REFERER']; header('Refresh:1; url=index.php'); } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title><?php echo $config['site_name']; ?> </title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content="rien"> <meta name="keywords" content="rien"/>