PHP Session and cookies with LOGIN -
i m new in php programming , tried understand cookies , session , how can used 1 code html
first want create login page -
2) response page ,without using db or mysql
if users true- saves username cookie, , sets session variable logggedin true.
displays link "content page".
3) content page - checks session variable - if user loggedin, says hello "xxxx" xxxx username cookie.
if not, displays link login page.
the code you..
<?php session_start(); if (isset($_post['submit'])) { $username = isset($_post['username']) ? $_post['username'] : ''; $password = isset($_post['password']) ? $_post['password'] : ''; $_session['username'] = $username; if (isset($_session['username'])) { echo 'logged in'; } else { echo 'check login'; } }
Comments
Post a Comment