Module 03 Course Project - Developer - Building the Website
MMALIK/.DS_Store
__MACOSX/MMALIK/._.DS_Store
MMALIK/activation.php
<?php include 'include/ses.php'; include 'include/controller.php'; ?> <!DOCTYPE html> <html> <head> <title>Activate your Account</title> <link rel="stylesheet" href="css/style.css"> </head> <body> <main> <form method="get" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"> <input type="text" name="activation_code" placeholder="Activation Code" autocomplete="off" required autofocus><br><br> <span class="alert"><?php echo $status; ?></span> <br><br> <input type="submit" name="activate"> </form> </main> </body> </html>
__MACOSX/MMALIK/._activation.php
MMALIK/change-password.php
<?php include 'include/session.php'; include 'include/controller.php'; ?> <!DOCTYPE html> <html> <head> <title>Change Password</title> <link rel="stylesheet" href="css/style.css"> </head> <body> <main> <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"> <input type="password" name="current" placeholder="Current Password" autocomplete="off" minlength="8" autofocus required> <br> <br> <input type="password" name="password" placeholder="Password" autocomplete="off" minlength="8" required> <br> <br> <input type="password" name="repass" placeholder="Retype Password" autocomplete="off" minlength="8" required> <br> <br> <input type="submit" name="changepass" value="Update"> <span class="alert"><?php echo $status; ?></span> </form> <a href="index.php"> <button class="button">Cancel</button> </a> </main> </body> </html>
__MACOSX/MMALIK/._change-password.php
MMALIK/css/style.css
*{ box-sizing: border-box; } html{ margin: 0; padding: 0; background-color: #ecf0f1; color: #c0392b; } .alert{ color: #d35400; } main{ height: 200px; width: 500px; margin-left: auto; margin-right: auto; align-self: center; } form{ width: 100%; } input[type="text"],input[type="password"],input[type="number"], input[type="submit"],.button, select{ padding: 7px; width: 100%; border: 1px solid #e67e22; color: #c0392b; outline-color: #d35400; } input[type="submit"]{ width: 100%; background-color: #d35400; color: #ecf0f1; } a{ color: #d35400; } a:hover{ color: #3498db; } table{ margin-top: 10px; width: 100%; border-collapse: collapse; } tr,th,td{ border: 2px solid #d35400; margin: 0; } td button{ padding: 2px 5px; color: #ecf0f1; text-decoration: none; width: 100%; padding: 3px; border: none; } tbody td button:hover{ color: #f1c40f; } tbody tr:hover{ background-color: #bdc3c7; } .default{ background-color: #27ae60 !important; } .warning{ background-color: #e67e22 !important; } .danger{ background-color: #d35400 !important; } .full{ padding: 7px; width: 100%; color: white; } .half{ width: 50% !important; float: left !important; } .mod{ width: 200px; }
__MACOSX/MMALIK/css/._style.css
MMALIK/css/style.min.css
* {box-sizing: border-box }html {margin: 0;padding: 0;background-color: #ecf0f1;color: #c0392b }.alert {color: #d35400 }main {height: 200px;width: 450px;margin-left: auto;margin-right: auto;align-self: center }form {width: 100% }input[type="text"], input[type="password"], input[type="submit"], .button, select {padding: 7px;width: 100%;border: 1px solid #e67e22;color: #c0392b;outline-color: #d35400 }input[type="submit"] {width: 100%;background-color: #d35400;color: #ecf0f1 }a {color: #d35400 }a:hover {color: #3498db }table {margin-top: 10px;width: 100%;border-collapse: collapse }tr, th, td {border: 2px solid #d35400 }td button {padding: 2px 5px;color: #ecf0f1;text-decoration: none;width: 100%;padding: 3px }tr:hover {background-color: #bdc3c7 }.default {background-color: #27ae60 }.warning {background-color: #e67e22 }.danger {background-color: #d35400 }.full {padding: 7px;width: 100%;color: white }.half {width: 50%;float: left }.mod {width: 200px }
__MACOSX/MMALIK/css/._style.min.css
__MACOSX/MMALIK/._css
MMALIK/dbtest.sql
-- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: July 29, 2017 at 03:55 AM -- Server version: 10.1.10-MariaDB -- PHP Version: 5.6.19 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `dbtest` -- -- -------------------------------------------------------- -- -- Table structure for table `tbl_security_question` -- CREATE TABLE `tbl_security_question` ( `security_question_id` int(11) NOT NULL, `security_question` varchar(128) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbl_security_question` -- INSERT INTO `tbl_security_question` (`security_question_id`, `security_question`) VALUES (1, 'What is the first and last name of your first boyfriend or girlfriend?'), (2, 'Which phone number do you remember most from your childhood?'), (3, 'What was your favorite place to visit as a child?'), (4, 'Who is your favorite actor, musician, or artist?'), (5, 'What is the name of your favorite pet?'), (6, 'In what city were you born?'), (7, 'What high school did you attend?'), (8, 'What is the name of your first school?'), (9, 'What is your favorite movie?'), (10, 'What is your mother''s maiden name?'), (11, 'What street did you grow up on?'), (12, 'What was the make of your first car?'), (13, 'When is your anniversary?'), (14, 'What is your favorite color?'), (15, 'What is your father''s middle name?'), (16, 'What is the name of your first grade teacher?'), (17, 'What was your high school mascot?'), (18, 'Which is your favorite web browser?'); -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE `user` ( `user_id` int(11) NOT NULL, `username` varchar(30) NOT NULL, `password` varchar(256) NOT NULL, `role` varchar(10) NOT NULL DEFAULT 'user', `status` varchar(10) NOT NULL DEFAULT 'inactive', `security_question_id` int(11) NOT NULL, `security_answer` varchar(256) NOT NULL, `mobile_no` int(20) NOT NULL, `activation_code` varchar(256) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `user` -- INSERT INTO `user` (`user_id`, `username`, `password`, `role`, `status`, `security_question_id`, `security_answer`, `mobile_no`, `activation_code`) VALUES (1, 'admin', '$2y$10$TCpCHap8CAhiWlB0S/XV/.PChmNQRAIsFY4ugRvsljMtyFw/eNpL2', 'Admin', 'active', 15, '$2y$10$C8FXZcYfIGRXvhj/BvOpP.7syZu5JFrqmmEkpgCdFCSl13qsfhPpe', 2147483647, '57e3b90d2296f'); -- -- Indexes for dumped tables -- -- -- Indexes for table `tbl_security_question` -- ALTER TABLE `tbl_security_question` ADD PRIMARY KEY (`security_question_id`); -- -- Indexes for table `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`user_id`), ADD UNIQUE KEY `username` (`username`), ADD KEY `security_question` (`security_question_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `tbl_security_question` -- ALTER TABLE `tbl_security_question` MODIFY `security_question_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19; -- -- AUTO_INCREMENT for table `user` -- ALTER TABLE `user` MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- Constraints for dumped tables -- -- -- Constraints for table `user` -- ALTER TABLE `user` ADD CONSTRAINT `user_ibfk_1` FOREIGN KEY (`security_question_id`) REFERENCES `tbl_security_question` (`security_question_id`); /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
__MACOSX/MMALIK/._dbtest.sql
MMALIK/edit.php
<?php include 'include/controller.php'; admin(); ?> <!DOCTYPE html> <html> <head> <title>Registration</title> <link rel="stylesheet" href="css/style.css"> </head> <body> <main> <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"> <?php edit_user(); ?> <br> <br> <input class="half" type='submit' name='edit_user' value='Edit'> </form> <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"> <input class="half warning" type="submit" name="cancel" value="Cancel"> </form> </main> </body> </html>
__MACOSX/MMALIK/._edit.php
MMALIK/forgot-Password-auth.php
<?php session_start(); if (!isset($_SESSION['forgot-password']) || (trim($_SESSION['forgot-password']) == '')) { header("location:forgot-password.php"); exit(); } $session_forgot = $_SESSION['forgot-password']; include 'include/controller.php'; ?> <!DOCTYPE html> <html> <head> <title>Forgot Password</title> <link rel="stylesheet" href="css/style.css"> </head> <body> <main> <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"> <label for="secanswer">Question: <?php question_auth(); ?></label> <input type="text" name="secanswer" placeholder="Security Answer" autocomplete="off" autofocus> <span class="alert"><?php echo $status; ?></span> <br><br> <input type="submit" name="forgot-password-auth" value="Submit"> </form> </main> </body> </html>
__MACOSX/MMALIK/._forgot-Password-auth.php
MMALIK/forgot-Password.php
<?php include 'include/ses.php'; include 'include/controller.php'; ?> <!DOCTYPE html> <html> <head> <title>Forgot Password</title> <link rel="stylesheet" href="css/style.css"> </head> <body> <main> <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"> <input type="text" name="username" placeholder="Username" autocomplete="off" required autofocus><br><br> <span class="alert"><?php echo $status; ?></span> <br><br> <input type="submit" name="forgot" value="Submit"> </form> </main> </body> </html>
__MACOSX/MMALIK/._forgot-Password.php
MMALIK/include/conn.php
<?php $servername = "localhost"; $username = "root"; $password = ""; $db = "password_hash"; try { $conn = new PDO("mysql:host=$servername;dbname=$db", $username, $password); // set the PDO error mode to exception $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch(PDOException $e) { echo "Connection failed: " . $e->getMessage(); } ?>
__MACOSX/MMALIK/include/._conn.php
MMALIK/include/controller.php
<?php include 'conn.php'; $id = $mobileErr= $answereErr = $questionseErr = $role = $user_id = $cpass = $user = $pass = $repass = $status = $usernameErr = $passwordErr = ""; // Sanitation function clean($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; } // Null Validation if ($_SERVER["REQUEST_METHOD"] == "POST") { if (empty($_POST["username"])) { $usernameErr = "Userame is required"; } else { $username = clean($_POST["username"]); } if (empty($_POST["password"])) { $passwordErr = "Password is required"; } else { $password = clean($_POST["password"]); } if (empty($_POST["repass"])) { $repassErr = "Password is required"; } else { $repass = clean($_POST["repass"]); } if (empty($_POST["current"])) { $repassErr = "Password is required"; } else { $cpass = clean($_POST["current"]); } if (empty($_POST["role"])) { $roleErr = "Role is Required"; } else { $role = clean($_POST["role"]); } if (empty($_POST["secanswer"])) { $answereErr = "Answer is Required"; } else { $answer = clean($_POST["secanswer"]); } if (empty($_POST["questions"])) { $questionseErr = "Questions is Required"; } else { $question = clean($_POST["questions"]); } if (empty($_POST["phone"])) { $mobileErr = "Mobile Number is Required"; } else { $mobile = clean($_POST["phone"]); } } // Registration Query if(isset($_POST['reg'])){ $stmt = $conn->prepare("SELECT * FROM user WHERE username=:username "); $stmt->bindParam(':username',$username); $stmt->execute(); $row = $stmt->fetch(); if($row>0){ $usernameErr = "* Unavailable"; } elseif($mobile == $row['mobile_no']) { $status = "* Mobile Number is already taken"; } elseif($password != $repass) { $passwordErr = "* Not Match!"; } else { $stmt = $conn->prepare("INSERT INTO user (username, password, security_question_id, security_answer, mobile_no, activation_code) VALUES (:username, :hash, :question, :answer, :mobile, :activation_code) "); $stmt->bindParam(':username', $username); $stmt->bindParam(':hash', $hash); $stmt->bindParam(':question', $question); $stmt->bindParam(':answer', $hashanswer); $stmt->bindParam(':mobile', $mobile); $stmt->bindParam(':activation_code', $activation); $activation = uniqid(); $hashanswer = dbtest($answer, PASSWORD_DEFAULT); $hash = dbtest($password, PASSWORD_DEFAULT); $stmt->execute(); $status = "Registration Success"; } } // Activation if(isset($_GET['activate'])){ $stmt = $conn->prepare("UPDATE user SET status='active' WHERE activation_code=:activation"); $stmt->bindParam(':activation',$activation); $activation = $_GET['activation_code']; // execute the query $stmt->execute(); $status = "Activated"; } // Login Query if(isset($_POST['login'])){ $stmt = $conn->prepare("SELECT * FROM user WHERE username=:username"); $stmt->bindParam(':username',$username); $stmt->execute(); $row = $stmt->fetch(); if($row>0){ $stmt->bindParam(':password',$password); if(password_verify($password, $row['password'])){ if($row['status'] == 'active'){ $_SESSION['username']=$row['username']; $_SESSION['role'] = $row['role']; header("location:index.php"); } else { $status = "Account is Inactive please Activate your account <a href='activation.php'>HERE</a> "; } } else { $status = "Invalid Credentials!"; } } else { $status = "Invalid Credentials!"; } } // Change Password Query if(isset($_POST['changepass'])){ $stmt = $conn->prepare("SELECT password FROM user WHERE username=:username "); $stmt->bindParam(':username',$session_username); $stmt->execute(); $row = $stmt->fetch(); if($row>0){ if(password_verify($cpass, $row['password'])){ if($password == $repass) { $stmt = $conn->prepare("UPDATE user SET password=:hash WHERE username='$session_username' "); $stmt->bindParam(':hash', $hash); $hash = dbtest($password, PASSWORD_DEFAULT); $stmt->execute(); echo "<script type=\"text/javascript\"> alert(\"Password Updated!.\"); window.location = \"index.php\" </script>"; } else { $status = "Password Not Match!"; } } else { $status = "Password Incorrect!"; } } } // Cancel if(isset($_POST['cancel'])){ header("location:index.php"); } // Display All User Except Deleted function alluser(){ include 'conn.php'; $stmt = $conn->prepare("SELECT * FROM user WHERE status!='delete' "); $stmt->execute(); while($row = $stmt->fetch()){ $user_id = $row['user_id']; $username = $row['username']; $role = $row['role']; $status = $row['status']; $question = $row['security_question_id']; echo " <tr> <td>$username</td> <td>$role</td> <td> <a href='index.php?$status=$user_id' ><button class='default'>$status</button></a></td> <td>$question</td> <td> <a href='edit.php?id=$user_id'><button class='warning half'>Edit</button></a> <a href='index?del=$user_id'><button class='danger half'>Delete</button></a> </td> </tr> "; } } // Deactivate Query if(isset($_GET['active'])){ if($session_role=='Admin' || $session_role=='Dev'){ $id=$_GET['active']; $stmt = $conn->prepare("UPDATE user SET status='inactive' WHERE user_id='$id' AND username!='$session_username'"); $stmt->execute(); header('location:index.php'); } else { echo "<script type=\"text/javascript\"> alert(\"Not Authorize.\"); window.location = \"index.php\" </script>"; } } // Activate Query if(isset($_GET['inactive'])){ if($session_role=='Admin' || $session_role=='Dev'){ $id=$_GET['inactive']; $stmt = $conn->prepare("UPDATE user SET status='active' WHERE user_id='$id' AND username!='$session_username' "); $stmt->execute(); header('location:index.php'); } else { echo "<script type=\"text/javascript\"> alert(\"Not Authorize.\"); window.location = \"index.php\" </script>"; } } // Edit User Function function edit_user(){ include 'conn.php'; $id = $_GET['id']; $stmt = $conn->prepare("SELECT * FROM user WHERE user_id='$id' "); $stmt->execute(); while($row = $stmt->fetch()){ $user_id = $row['user_id']; $username = $row['username']; $password = $row['password']; $role = $row['role']; $status = $row['status']; echo " <input type='text' name='post_id' value='$user_id' hidden> <input type='text' name='username' placeholder='Username' autocomplete='off' minlength='4' autofocus required value='$username' readonly> <br><br> <select name='role'> <option value='$role'>$role</option> <option value='User'>User</option> <option value='Admin'>Admin</option> <option value='Dev'>Dev</option> </select>"; } } // Display All Questions in Select Option function questions(){ include 'conn.php'; $stmt = $conn->prepare("SELECT * FROM tbl_security_question"); $stmt->execute(); while($row = $stmt->fetch()){ $question = $row['security_question']; $id = $row['security_question_id']; echo "<option value='$id'>$question</option>"; } } //Update Security Question function secquestion(){ include 'session.php'; include 'conn.php'; $stmt = $conn->prepare("SELECT * FROM user WHERE username='$session_username' "); $stmt->execute(); while($row = $stmt->fetch()){ $stmt = $conn->prepare("SELECT * FROM tbl_security_question"); $stmt->execute(); while($row = $stmt->fetch()){ $question = $row['security_question']; $id = $row['security_question_id']; echo "<option value='$id'>$question</option>"; } } if(isset($_POST['security_questions'])){ $question = $_POST['questions']; $answer = $_POST['secanswer']; $stmt = $conn->prepare("UPDATE user SET security_question_id=:question, security_answer=:answer WHERE username='$session_username' "); $stmt->bindParam(':question', $question); $stmt->bindParam(':answer', $answer); $answer = dbtest($answer, PASSWORD_DEFAULT); $stmt->execute(); echo "<script type=\"text/javascript\"> alert(\"Updated!.\"); window.location = \"index.php\" </script>"; } } //if Username is correct if(isset($_POST['forgot'])){ $stmt = $conn->prepare("SELECT * FROM user WHERE username=:username"); $stmt->bindParam(':username',$username); $stmt->execute(); $row = $stmt->fetch(); if($row>0){ $id = $row['security_question_id']; $_SESSION['forgot-password']=$row['username']; echo "<script type=\"text/javascript\"> alert(\"Updated!.\"); window.location = \"forgot-Password-auth.php\" </script>"; } else{ $status = "Wrong Username"; } } function question_auth(){ global $conn; global $session_forgot; $stmt = $conn->prepare("SELECT tbl_security_question.security_question AS question FROM tbl_security_question JOIN user ON tbl_security_question.security_question_id=user.security_question_id WHERE user.username='$session_forgot' "); $stmt->execute(); while($row = $stmt->fetch()){ $question = $row['question']; echo $question; } } //forgot password auth success if(isset($_POST['forgot-password-auth'])){ $secanswer = $_POST['secanswer']; $stmt = $conn->prepare("SELECT security_answer FROM user WHERE username='$session_forgot' "); $row = $stmt->fetch(); if($row >0){ if(password_verify($password, $row['password'])){ header('location: retrieving.php'); } } } // Edit User Query if(isset($_POST['edit_user'])){ $id=$_POST['post_id']; $stmt = $conn->prepare("UPDATE user SET role=:role WHERE user_id='$id' "); $stmt->bindParam(':role', $role); $stmt->execute(); echo "<script type=\"text/javascript\"> alert(\"Updated!.\"); window.location = \"index.php\" </script>"; } // Admin Session Only function admin(){ include 'session.php'; if($session_role=='Admin' || $session_role=='Dev'){ } else { echo "<script type=\"text/javascript\"> alert(\"Authorized Only!.\"); window.location = \"index.php\" </script>"; } } //Delete Query if(isset($_GET['del'])){ $id = $_GET['del']; $stmt = $conn->prepare("UPDATE user SET status='delete' WHERE user_id='$id' AND user_id>=2 "); if($stmt->execute()){ echo "<script type=\"text/javascript\"> alert(\"Deletdasdased!.\"); window.location = \"index.php\" </script>"; } else { echo "<script type=\"text/javascript\"> alert(\"Not Deleted!.\"); window.location = \"index.php\" </script>"; } } ?>
__MACOSX/MMALIK/include/._controller.php
MMALIK/include/ses.php
<?php //Start session session_start(); //Check whether the session variable SESS_MEMBER_ID is present or not if (isset($_SESSION['username'])){ header("location:index.php"); exit(); } ?>
__MACOSX/MMALIK/include/._ses.php
MMALIK/include/session.php
<?php //Start session session_start(); //Check whether the session variable $_SESSION['username'] is present or not if (!isset($_SESSION['username']) || (trim($_SESSION['username']) == '')) { header("location:login.php"); exit(); } if (!isset($_SESSION['role']) || (trim($_SESSION['role']) == '')) { header("location:login.php"); exit(); } $session_username = $_SESSION['username']; $session_role = $_SESSION['role']; ?>
__MACOSX/MMALIK/include/._session.php
__MACOSX/MMALIK/._include
MMALIK/index.php
<?php include 'include/session.php'; include 'include/controller.php'; ?> <!DOCTYPE html> <html> <head> <title>Index</title> <link rel="stylesheet" href="css/style.css"> </head> <body> <main> Welcome <strong><?php echo $session_role . "</strong>[ $session_username ]" ?> <br> <a href="logout.php">Logout</a> | <a href="change-password.php">Update Password</a> <a href="security-question.php">Security Question</a> <?php if($session_role == 'Admin' || $session_role=='Dev'){ ?> <table> <thead> <tr> <th>Username</th> <th>Role</th> <th width="70px">Status</th> <th>Question</th> <th class='mod'>Modify</th> </tr> </thead> <tbody> <?php alluser(); ?> </tbody> </table> <?php } ?> </main> </body> </html>
__MACOSX/MMALIK/._index.php
MMALIK/join.php
<?php echo "<table style='border: solid 1px black;'>"; echo "<tr><th>Last Name</th><th>First Name</th><th>Course</th><th>Subject</th><th>Grade</th></tr>"; class TableRows extends RecursiveIteratorIterator { function __construct($it) { parent::__construct($it, self::LEAVES_ONLY); } function current() { return "<td style='width:150px;border:1px solid black;'>" . parent::current(). "</td>"; } function beginChildren() { echo "<tr>"; } function endChildren() { echo "</tr>" . "\n"; } } $servername = "localhost"; $username = "root"; $password = ""; $dbname = "grading"; try { $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $stmt = $conn->prepare(" SELECT students.LastName,students.FirstName,students.Course, subjects.Subject_Code, grades.grade FROM grades JOIN students ON students.student_id=grades.student_id JOIN subjects ON subjects.subject_id=grades.subject_id ORDER BY grades.grade DESC"); $stmt->execute(); // set the resulting array to associative $row = $result = $stmt->setFetchMode(PDO::FETCH_ASSOC); foreach(new TableRows(new RecursiveArrayIterator($stmt->fetchAll())) as $k=>$v) { echo $v; } } catch(PDOException $e) { echo "Error: " . $e->getMessage(); } $conn = null; echo "</table>"; ?>
__MACOSX/MMALIK/._join.php
MMALIK/keygen.php
<form action="" method="post"> Username: <input type="text" name="user"> Encryption: <keygen name="security"> <input type="submit" name="enc"> </form> <form action="" oninput="x.value=parseInt(a.value)+parseInt(b.value)"> 0 <input type="range" id="a" name="a" value="50"> 100 + <input type="number" id="b" name="b" value="50"> = <output name="x" for="a b"></output> <br><br> <input type="submit"> </form> <?php if(isset($_POST['enc'])){ $user = $_POST['user']; $encryption = $_POST['security']; echo "User: $user <br> Encryption: $encryption "; echo $encryption; } ?>
__MACOSX/MMALIK/._keygen.php
MMALIK/login.php
<?php include 'include/ses.php'; include 'include/controller.php'; ?> <!DOCTYPE html> <html> <head> <title>Login</title> <link rel="stylesheet" href="css/style.css"> </head> <body> <main> <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"> <input type="text" name="username" placeholder="Username" autocomplete="off" required autofocus> <br> <br> <input type="password" name="password" placeholder="Password" autocomplete="off" required minlength="8"> <br> <br> <input type="submit" name="login" value="login"> <span class="alert"><?php echo $status . "<br>"; ?></span> </form> <a href="forgot-Password.php">Forgot Password?</a> You don't have an account? <a href="reg.php">Register Here</a> </main> </body> </html>
__MACOSX/MMALIK/._login.php
MMALIK/logout.php
<?php session_start(); // remove all session variables session_unset(); // destroy the session session_destroy(); header("location:login.php"); ?>
__MACOSX/MMALIK/._logout.php
MMALIK/PasswordHash/.git/COMMIT_EDITMSG
:boom::camel: Added .gitattributes & .gitignore files
__MACOSX/MMALIK/PasswordHash/.git/._COMMIT_EDITMSG
MMALIK/PasswordHash/.git/config
[core] bare = false filemode = false symlinks = false ignorecase = true logallrefupdates = true [core] repositoryformatversion = 0 [remote "origin"] url = https://github.com/tdtdevelopers/PasswordHash.git [remote "origin"] fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin merge = refs/heads/master
__MACOSX/MMALIK/PasswordHash/.git/._config
MMALIK/PasswordHash/.git/description
Unnamed repository; edit this file 'description' to name the repository.
__MACOSX/MMALIK/PasswordHash/.git/._description
MMALIK/PasswordHash/.git/FETCH_HEAD
7b114bf5bf3a9e866f712a9d4ee7f0b0f0d4db61 branch 'master' of https://github.com/tdtdevelopers/PasswordHash
__MACOSX/MMALIK/PasswordHash/.git/._FETCH_HEAD
MMALIK/PasswordHash/.git/HEAD
ref: refs/heads/fsdfss
__MACOSX/MMALIK/PasswordHash/.git/._HEAD
MMALIK/PasswordHash/.git/hooks/README.sample
#!/bin/sh # # Place appropriately named executable hook scripts into this directory # to intercept various actions that git takes. See `git help hooks` for # more information.
__MACOSX/MMALIK/PasswordHash/.git/hooks/._README.sample
__MACOSX/MMALIK/PasswordHash/.git/._hooks
MMALIK/PasswordHash/.git/index
__MACOSX/MMALIK/PasswordHash/.git/._index
MMALIK/PasswordHash/.git/info/exclude
# File patterns to ignore; see `git help ignore` for more information. # Lines that start with '#' are comments.
__MACOSX/MMALIK/PasswordHash/.git/info/._exclude
__MACOSX/MMALIK/PasswordHash/.git/._info
MMALIK/PasswordHash/.git/logs/HEAD
0000000000000000000000000000000000000000 7b114bf5bf3a9e866f712a9d4ee7f0b0f0d4db61 tdtdevelopers <[email protected]> 1473951570 +0800 commit (initial): :boom::camel: Added .gitattributes & .gitignore files 7b114bf5bf3a9e866f712a9d4ee7f0b0f0d4db61 7b114bf5bf3a9e866f712a9d4ee7f0b0f0d4db61 tdtdevelopers <[email protected]> 1473951915 +0800 checkout: moving from master to fsdfss
__MACOSX/MMALIK/PasswordHash/.git/logs/._HEAD
MMALIK/PasswordHash/.git/logs/refs/heads/fsdfss
0000000000000000000000000000000000000000 7b114bf5bf3a9e866f712a9d4ee7f0b0f0d4db61 tdtdevelopers <[email protected]> 1473951915 +0800 branch: Created from master
__MACOSX/MMALIK/PasswordHash/.git/logs/refs/heads/._fsdfss
MMALIK/PasswordHash/.git/logs/refs/heads/master
0000000000000000000000000000000000000000 7b114bf5bf3a9e866f712a9d4ee7f0b0f0d4db61 tdtdevelopers <[email protected]> 1473951570 +0800 commit (initial): :boom::camel: Added .gitattributes & .gitignore files
__MACOSX/MMALIK/PasswordHash/.git/logs/refs/heads/._master
__MACOSX/MMALIK/PasswordHash/.git/logs/refs/._heads
MMALIK/PasswordHash/.git/logs/refs/remotes/origin/master
0000000000000000000000000000000000000000 7b114bf5bf3a9e866f712a9d4ee7f0b0f0d4db61 tdtdevelopers <[email protected]> 1473951681 +0800 update by push
__MACOSX/MMALIK/PasswordHash/.git/logs/refs/remotes/origin/._master
__MACOSX/MMALIK/PasswordHash/.git/logs/refs/remotes/._origin
__MACOSX/MMALIK/PasswordHash/.git/logs/refs/._remotes
__MACOSX/MMALIK/PasswordHash/.git/logs/._refs
__MACOSX/MMALIK/PasswordHash/.git/._logs
MMALIK/PasswordHash/.git/objects/4e/007610d905bd04d2779c5eed42baf4882da8d9
MMALIK/PasswordHash/.git/objects/4e/007610d905bd04d2779c5eed42baf4882da8d9
__MACOSX/MMALIK/PasswordHash/.git/objects/4e/._007610d905bd04d2779c5eed42baf4882da8d9
__MACOSX/MMALIK/PasswordHash/.git/objects/._4e
MMALIK/PasswordHash/.git/objects/7b/114bf5bf3a9e866f712a9d4ee7f0b0f0d4db61
MMALIK/PasswordHash/.git/objects/7b/114bf5bf3a9e866f712a9d4ee7f0b0f0d4db61
commit 234�tree 4e007610d905bd04d2779c5eed42baf4882da8d9 author tdtdevelopers <[email protected]> 1473951570 +0800 committer tdtdevelopers <[email protected]> 1473951570 +0800 :boom::camel: Added .gitattributes & .gitignore files
__MACOSX/MMALIK/PasswordHash/.git/objects/7b/._114bf5bf3a9e866f712a9d4ee7f0b0f0d4db61
__MACOSX/MMALIK/PasswordHash/.git/objects/._7b
MMALIK/PasswordHash/.git/objects/bd/b0cabc87cf50106df6e15097dff816c8c3eb34
MMALIK/PasswordHash/.git/objects/bd/b0cabc87cf50106df6e15097dff816c8c3eb34
blob 378�# Auto detect text files and perform LF normalization * text=auto # Custom for Visual Studio *.cs diff=csharp # Standard to msysgit *.doc diff=astextplain *.DOC diff=astextplain *.docx diff=astextplain *.DOCX diff=astextplain *.dot diff=astextplain *.DOT diff=astextplain *.pdf diff=astextplain *.PDF diff=astextplain *.rtf diff=astextplain *.RTF diff=astextplain
__MACOSX/MMALIK/PasswordHash/.git/objects/bd/._b0cabc87cf50106df6e15097dff816c8c3eb34
__MACOSX/MMALIK/PasswordHash/.git/objects/._bd
MMALIK/PasswordHash/.git/objects/cd/2946ad76b4402e5b3cab9243a9281aad228670
MMALIK/PasswordHash/.git/objects/cd/2946ad76b4402e5b3cab9243a9281aad228670
blob 649�# Windows image file caches Thumbs.db ehthumbs.db # Folder config file Desktop.ini # Recycle Bin used on file shares $RECYCLE.BIN/ # Windows Installer files *.cab *.msi *.msm *.msp # Windows shortcuts *.lnk # ========================= # Operating System Files # ========================= # OSX # ========================= .DS_Store .AppleDouble .LSOverride # Thumbnails ._* # Files that might appear in the root of a volume .DocumentRevisions-V100 .fseventsd .Spotlight-V100 .TemporaryItems .Trashes .VolumeIcon.icns # Directories potentially created on remote AFP share .AppleDB .AppleDesktop Network Trash Folder Temporary Items .apdisk
__MACOSX/MMALIK/PasswordHash/.git/objects/cd/._2946ad76b4402e5b3cab9243a9281aad228670
__MACOSX/MMALIK/PasswordHash/.git/objects/._cd
__MACOSX/MMALIK/PasswordHash/.git/objects/._info
__MACOSX/MMALIK/PasswordHash/.git/objects/._pack
__MACOSX/MMALIK/PasswordHash/.git/._objects
MMALIK/PasswordHash/.git/refs/heads/fsdfss
7b114bf5bf3a9e866f712a9d4ee7f0b0f0d4db61
__MACOSX/MMALIK/PasswordHash/.git/refs/heads/._fsdfss
MMALIK/PasswordHash/.git/refs/heads/master
7b114bf5bf3a9e866f712a9d4ee7f0b0f0d4db61
__MACOSX/MMALIK/PasswordHash/.git/refs/heads/._master
__MACOSX/MMALIK/PasswordHash/.git/refs/._heads
MMALIK/PasswordHash/.git/refs/remotes/origin/master
7b114bf5bf3a9e866f712a9d4ee7f0b0f0d4db61
__MACOSX/MMALIK/PasswordHash/.git/refs/remotes/origin/._master
__MACOSX/MMALIK/PasswordHash/.git/refs/remotes/._origin
__MACOSX/MMALIK/PasswordHash/.git/refs/._remotes
__MACOSX/MMALIK/PasswordHash/.git/refs/._tags
__MACOSX/MMALIK/PasswordHash/.git/._refs
__MACOSX/MMALIK/PasswordHash/._.git
MMALIK/PasswordHash/.gitattributes
# Auto detect text files and perform LF normalization * text=auto # Custom for Visual Studio *.cs diff=csharp # Standard to msysgit *.doc diff=astextplain *.DOC diff=astextplain *.docx diff=astextplain *.DOCX diff=astextplain *.dot diff=astextplain *.DOT diff=astextplain *.pdf diff=astextplain *.PDF diff=astextplain *.rtf diff=astextplain *.RTF diff=astextplain
__MACOSX/MMALIK/PasswordHash/._.gitattributes
MMALIK/PasswordHash/.gitignore
# Windows image file caches Thumbs.db ehthumbs.db # Folder config file Desktop.ini # Recycle Bin used on file shares $RECYCLE.BIN/ # Windows Installer files *.cab *.msi *.msm *.msp # Windows shortcuts *.lnk # ========================= # Operating System Files # ========================= # OSX # ========================= .DS_Store .AppleDouble .LSOverride # Thumbnails ._* # Files that might appear in the root of a volume .DocumentRevisions-V100 .fseventsd .Spotlight-V100 .TemporaryItems .Trashes .VolumeIcon.icns # Directories potentially created on remote AFP share .AppleDB .AppleDesktop Network Trash Folder Temporary Items .apdisk
__MACOSX/MMALIK/PasswordHash/._.gitignore
__MACOSX/MMALIK/._PasswordHash
MMALIK/PasswordHash.php
<?php include 'include/conn.php'; $password = '$MMALIK'; $hash = password_hash($password, PASSWORD_DEFAULT); echo $hash . "<br>"; if(password_verify($password, $hash)){ echo 'Password is valid'; } else{ echo 'Password is Invalid'; } ?>
__MACOSX/MMALIK/._PasswordHash.php
MMALIK/reg.php
<?php include 'include/ses.php'; include 'include/controller.php'; ?> <!DOCTYPE html> <html> <head> <title>Registration</title> <link rel="stylesheet" href="css/style.css"> </head> <body> <main> <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"> <input type="text" name="username" placeholder="Username" autocomplete="off" minlength="4" autofocus required> <span class="alert"><?php echo $usernameErr; ?></span> <br> <br> <select name="questions"> <?php questions(); ?> </select> <br> <br> <input type="password" name="secanswer" required placeholder="Security Answer"><span class="alert"><?php echo $answereErr; ?></span> <br> <br> <input type="number" name="phone" required placeholder="Mobile Number"><span class="alert"><?php echo $mobileErr; ?></span> <br> <br> <input type="password" name="password" placeholder="Password" autocomplete="off" minlength="8" required> <br> <br> <input type="password" name="repass" placeholder="Retype Password" autocomplete="off" minlength="8" required> <span class="alert"><?php echo $passwordErr; ?></span> <br> <br> <input type="submit" name="reg" value="Register"> <div class="alert"> <?php echo $status; ?> </div> </form> Already have an account? <a href="login.php">Login Here</a> </main> </body> </html>
__MACOSX/MMALIK/._reg.php
MMALIK/retrieving.php
<?php include 'include/ses.php'; include 'include/controller.php'; ?> <!DOCTYPE html> <html> <head> <title>Forgot Password</title> <link rel="stylesheet" href="css/style.css"> </head> <body> <main> <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"> <input type="password" name="password" placeholder="Password" autocomplete="off" minlength="8" required> <br><br> <input type="password" name="repass" placeholder="Retype Password" autocomplete="off" minlength="8" required> <br><br> <input type="submit" name="forgot" value="Submit"> </form> </main> </body> </html>
__MACOSX/MMALIK/._retrieving.php
MMALIK/security-question.php
<?php include 'include/controller.php'; ?> <!DOCTYPE html> <html> <head> <title>Security Questions</title> <link rel="stylesheet" href="css/style.css"> </head> <body> <main> <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"> <select name="questions"> <?php secquestion(); ?> </select><br><br> <input type="password" name="secanswer" required placeholder="Security Answer"><br><br> <input class="half default" type="submit" name="security_questions" value="Submit"> </form> <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"> <input class="half warning" type="submit" name="cancel" value="Cancel"> </form> </main> </body> </html>