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

Popular posts from this blog

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

javascript - Restarting Supervisor and effect on FlaskSocketIO -

php - Mongodb connectivity error -