Php $ _ SESSION members log on to the instance to share, and _ session members log on. Php $ _ SESSION member login instance sharing, _ session member login php member login module is a very simple module in website development, this instance is mainly for php beginners a simple reference, its php $ _ SESSION member logs on to the instance for sharing, and _ session member logs on
The php member login module is a very simple module in website development. this example provides a simple reference for php beginners. the logic of this module is to be understood by the Reader, edited, and thought-provoking.
Login. php file
<?php ob_start(); session_start();?><? // error_reporting(E_ALL); // ini_set("display_errors", 1);?> Tutorialspoint.com
Enter Username and Password <?php $msg = ''; if (isset($_POST['login']) && !empty($_POST['username']) && !empty($_POST['password'])) { if ($_POST['username'] == 'tutorialspoint' && $_POST['password'] == '1234') { $_SESSION['valid'] = true; $_SESSION['timeout'] = time(); $_SESSION['username'] = 'tutorialspoint'; echo 'You have entered valid use name and password'; } else { $msg = 'Wrong username or password'; } } ?>
Click here to clean Session.
Logout. php file
<?php session_start(); unset($_SESSION["username"]); unset($_SESSION["password"]); echo 'You have cleaned session'; header('Refresh: 2; URL=login.php');?>
The above is all the content of this article, hoping to help you learn.
Articles you may be interested in:
- Php code for importing member data to ucenter
- Practical PHP member permission control implementation principle analysis
- PHP + MYSQL implementation code for permission judgment upon login of the member system
- Php development documentation members are charged for Phase 1
- PHP + MYSQL member system development example tutorial
- Php uses $ _ POST or $ _ SESSION [] to pass parameters to js functions.
- PHP to generate a unique membership card number
Http://www.bkjia.com/PHPjc/1117078.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/1117078.htmlTechArticlephp $ _ SESSION member login instance sharing, _ session member login php member login module is a very simple module in website development, this instance is mainly for php beginners a simple reference, its...