Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (isset($_SESSION['teacherusername']))
- {
- $username = $_SESSION['teacherusername'];
- }
- ?>
- <?php
- // PHP code
- session_start();
- ini_set('display_errors',1);
- error_reporting(E_ALL);
- // connect to the database
- include('connect.php');
- include('member.php');
- /* check connection */
- if (mysqli_connect_errno()) {
- printf("Connect failed: %sn", mysqli_connect_error());
- die();
- }
- // required variables (make them explciit no need for foreach loop)
- $teacherusername = (isset($_POST['teacherusername'])) ? $_POST['teacherusername'] : '';
- $teacherpassword = (isset($_POST['teacherpassword'])) ? $_POST['teacherpassword'] : '';
- $loggedIn = false;
- $active = true;
- if ($username){
- echo "You are already Logged In: <b>{$_SESSION['teacherforename']} {$_SESSION['teachersurname']}</b> | <a href='./teacherlogout.php'>Logout</a>";
- }
- else{
- echo "Please Login";
- }
- ?>
- $username = "";
- if (isset($_SESSION['teacherusername'])) {
- $username = $_SESSION['teacherusername'];
- }
- $username = $_SESSION['teacherusername'];
- }
- $username = null; // ad this line to member.php
- if (isset($_SESSION['teacherusername'])) {
- $username = $_SESSION['teacherusername'];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement