Server IP : 172.16.15.8 / Your IP : 18.226.17.251 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();?> <html> <style> #header { text-align:center; height: 200px; padding:10px; } #left { line-height:40px; height:300px; width: 45%; vertical-align: middle; float:left; padding:10px; positon: absolute; border-style: double; border-width: medium; display:inline-block; } #middle { height:300px; width:90%; vertical-align: middle; position:absolute; border-style: double; border-width: medium; overflow: auto; } #right { line-height:40px; height:200px; width: 45%; vertical-align: middle; float:right; padding:10px; positon: absolute; border-style: double; border-width: medium; display:inline-block; overflow: auto; } #clearfix { clear:both; } </style> </html> <?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 = mysql_connect($host, $user, $passwd); mysql_select_db($database); $query = "select * from Courses"; $CResult_id = mysql_query($query, $connect); $InfoQuery = "select FName, LName, ContactInfo from BBUsers where Year > -1 && Username not like '$username'"; $InfoResult_id = mysql_query($InfoQuery, $connect); $check = mysql_query("select count(1) from BBUsers where Username like '$username' and Password like '$pass'"); if(mysql_num_rows($check) > 0) { $sql = "select count(1) from BBUsers where Username like '$username' and Password like '$pass'"; $result = mysql_query($sql); $hasmatch = mysql_result($result, 0); if($hasmatch) { $Username = mysql_result(mysql_query("select Username from BBUsers where Username like '$username'"), 0); $Password = mysql_result(mysql_query("select Password from BBUsers where Username like '$username'"), 0); $Fname = mysql_result(mysql_query("select FName from BBUsers where Username like '$username'"), 0); $Lname = mysql_result(mysql_query("select LName from BBUsers where Username like '$username'"), 0); $PorS = mysql_result(mysql_query("select Year from BBUsers where Username like '$username'"), 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> <hr><hr> <?php if($CResult_id) { print "List of Availible Courses:<br>"; print '<table border = 1>'; print "<th> Course <th> Professor"; while($row = mysql_fetch_row($CResult_id)) { print '<tr>'; foreach($row as $field) print "<td> $field </td> "; print '</tr>'; } } echo "\n\n"; ?> <INPUT Type=button VALUE=My Courses onClick="location.href = 'BBCourses.php'" style = "width: 100px;"> <?php print "Contact Information:<br>"; if($InfoResult_id) { print '<table border = 1>'; print "<th> First Name <th> Last Name <th> Email"; while($row = mysql_fetch_row($InfoResult_id)) { print '<tr>'; foreach($row as $field) print "<td> $field </td>"; print '</tr>'; } } ?> <div id = "clearfix"> <br><hr><br> <form action = "BBPassword.php"> <input type = submit value = "Reset Password?"> </form> <form action = "BBLogout.php"> <input type = submit value = "Log Out"> </form> </div> <?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 } mysql_close($connect); } ?>