Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

the link for the started code is below: https://drive.google.com/file/d/1b7_GMqF

ID: 3912668 • Letter: T

Question

the link for the started code is below: https://drive.google.com/file/d/1b7_GMqFKMZwMPWFBEjqhrFdn4kow5rSx/view?ths=true
Goal The goal of this project is to design an image sharing app /site using all the concepts, languages, and technologies learned throughout the class. This task will be structured in a series of milestones, as follows: o Milestone 1: user authentication o Milestone 2: session management o Milestone 3: basic photo uploader o Milestone 4: improved photo uploader o Milestone 5: additional features o Milestone 6: preparation of the final app Recommended Procedure 1. Make sure you have your lamp.cse.fau.edu server space set up. Please note that you must have a server setup for your PHP code to work. Milestone 1: user authentication 2. Create a table ('USERS' for storing user information (see example 12.3 in Nixon's book). It should contain 2 fields per record, namely: userid and password. The password should be stored in encrypted form (after "salting" and hashing) (see example 12.4 in Nixon's book). Implement the functionality that allows a user to login (by entering their userid and password and matching against the data stored in the USERS table in the database). See example 26.7 in Nixon's book for the basic functionality (ignore the visual aspects, please!). After successful login, display a page that shows a simple 'Success' message Implement the functionality that allows a user to sign up (by entering their intended userid and password): if the userid is no longer available, display an error message; otherwise, add the new userid and associated (encrypted) password to the 'USERS' table in the database and display a simple Success' message. (Optionally, you might want to enforce password rules, such as minimum length, etc.) 3. 4. 5. Improve the visual aspects of your login/signup page and make it Bootstrap-based. See examples at ni ist.github.c bMinaise 874 e htt Create a page that looks like you want your future 'wall' to look. Don't forget to include a Logout' button in the page 6.

Explanation / Answer

Answer:

Here, I have following files in HTML as shown

Script:

<?php

session_start();

$con = mysqli_connect("localhost","root","","phppot_examples");

$mssg="";

if(!empty($_POST["logged"])) {

$res = mysqli_query($con,"SELECT * FROM USERS WHERE uname='" . $_POST["uname"] . "' and pswd = '". $_POST["pswd"]."'");

$ro = mysqli_fetch_array($res);

if(is_array($ro)) {

$_SESSION["user_id"] = $ro['user_id'];

} else {

$mssg = "ERROR: Please check Username or Password!";

}

}

if(!empty($_POST["logout"])) {

$_SESSION["user_id"] = "";

session_destroy();

}

?>

<HTML>

<HEAD>

<TITLE>Login Form</TITLE>

<style>

#frmLogin {

padding: 20px 60px;

background: #B6E0FF;

color: #555;

display: inline-block;

border-radius: 4px;

}

.fldGrp {

margin:15px 0px;

}

.div11 {

padding: 8px;width: 200px;

border: #A3C3E7 1px solid;

border-radius: 4px;

}

.submitBtn {

background: #65C370;

border: 0;

padding: 8px 20px;

border-radius: 4px;

color: #FFF;

text-transform: uppercase;

}

.memDash {

padding: 40px;

background: #D2EDD5;

color: #555;

border-radius: 4px;

display: inline-block;

text-align:center;

}

.outBtn {

color: #09F;

text-decoration: none;

background: none;

border: none;

padding: 0px;

cursor: pointer;

}

.errMssg {

text-align:center;

color:#FF0000;

}

.demo-content label{

width:auto;

}

</style>

</HEAD>

<BODY>

<div>

<div>

<?php if(empty($_SESSION["user_id"])) { ?>

<form action="" method="post" id="frmLogin">

<div class="errMssg"><?php if(isset($mssg)) { echo $mssg; } ?></div>

<div class="fldGrp">

<div><label for="logged">Username</label></div>

<div><input name="uname" type="text" class="div11"></div>

</div>

<div class="fldGrp">

<div><label for="pswd">Password</label></div>

<div><input name="pswd" type="pswd" class="div11"> </div>

</div>

<div class="fldGrp">

<div><input type="submit" name="logged" value="Login" class="SubmitBtn"></span></div>

</div>  

</form>

<?php

} else {

$res = mysqlI_query($con,"SELECT * FROM USERS WHERE user_id='" . $_SESSION["user_id"] . "'");

$ro = mysqli_fetch_array($res);

?>

<form action="" method="post" id="logout">

<div class="memDash">Welcome <?php echo ucwords($ro['display_name']); ?>, Logged successfully!<br>

Click to <input type="submit" name="logout" value="Logout" class="outBtn">.</div>

</form>

</div>

</div>

<?php

}

?>

</BODY>

</HTML>