Code done on login form.
Expand|Select|Wrap|Line Numbers
- <?php
- // this starts the session
- session_start();
- // this sets variables in the session
- $_SESSION['username']=$_POST['username'];
- ?>
Expand|Select|Wrap|Line Numbers
- <?php
- // this starts the session
- session_start();
- // echo variable from the session, we set this on our other page
- echo "welcome ".$_SESSION['username'];
- ?>