Php $ _ SESSION member logon instance sharing, _ session member logon _ PHP Tutorial

Source: Internet
Author: User
Tags tutorialspoint
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...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.