-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
141 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
session_start (); | ||
require_once('setting/server_config.php'); | ||
$AccountTable_name= "useraccount"; | ||
$useremail = $_REQUEST ["useremail"]; | ||
$oldpassword = $_REQUEST ["oldpassword"]; | ||
$newpassword = $_REQUEST ["newpassword"]; | ||
|
||
|
||
$retusername = null; | ||
$retpassword = null; | ||
$result = mysqli_query ($conn, "SELECT * FROM $AccountTable_name WHERE User_email ='$useremail';"); | ||
while ( $row = mysqli_fetch_array ( $result ) ) { | ||
$retuseremail = $row ["User_email"]; | ||
$retpassword = $row ["User_Password"]; | ||
} | ||
|
||
if (is_null ( $retuseremail )) { | ||
echo "<script>alert('email does not exist'); window.location.href='alterpassword.php' </script>"; | ||
exit(); | ||
} | ||
|
||
if ($oldpassword != $retpassword) { | ||
echo "<script>alert('old password wrong'); window.location.href='alterpassword.php' </script>"; | ||
exit(); | ||
} | ||
mysqli_query ($conn, "UPDATE $AccountTable_name SET User_password='$newpassword' WHERE User_email='$useremail'" ); | ||
mysqli_close ( $conn ); | ||
|
||
header('Location: index.php'); | ||
echo "password change successfully"; | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<!-- | ||
Author: W3layouts | ||
Author URL: http://w3layouts.com | ||
License: Creative Commons Attribution 3.0 Unported | ||
License URL: http://creativecommons.org/licenses/by/3.0/ | ||
--> | ||
<!DOCTYPE html> | ||
<?php | ||
session_start(); | ||
?> | ||
<html> | ||
<head> | ||
<title>UB TRADE</title> | ||
<link rel="stylesheet" href="css/bootstrap.min.css"><!-- bootstrap-CSS --> | ||
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" /><!-- style.css --> | ||
<link rel="stylesheet" href="css/font-awesome.min.css" /><!-- fontawesome-CSS --> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<!-- header --> | ||
<header> | ||
<div class="w3ls-header"><!--header-one--> | ||
<div class="w3ls-header-right"> | ||
<ul> | ||
<li class="dropdown head-dpdn"> | ||
<a href="signin_front.php" aria-expanded="false"><i class="fa fa-user" aria-hidden="true"></i> | ||
<a> | ||
<?php if (isset($_SESSION['username'])) | ||
{ | ||
echo $_SESSION['username']; | ||
} else echo"Sign In"?></a> | ||
</li> | ||
</ul> | ||
</div> | ||
|
||
<div class="clearfix"> </div> | ||
</div> | ||
<div class="container"> | ||
<div class="agile-its-header"> | ||
<div class="logo"> | ||
<h1><a href="index.php"><span>UB</span>TRADE</a></h1> | ||
</div> | ||
<div class="agileits_search"> | ||
<a class="post-w3layouts-ad" href="index.php">Back to Homepage</a> | ||
</div> | ||
<div class="clearfix"></div> | ||
</div> | ||
</div> | ||
</header> | ||
<!-- //header --> | ||
<!-- sign in form --> | ||
<section> | ||
<div id="agileits-sign-in-page" class="sign-in-wrapper"> | ||
<div class="agileinfo_signin"> | ||
<h3>Account information</h3> | ||
<form action="alterpassword.handle.php" method="post"> | ||
<input type="email" name="useremail" placeholder="Your_Email" required=""> | ||
<input type="password" name="oldpassword" placeholder="Old Password" required=""> | ||
<input type="password" name="newpassword" placeholder="New Password" required=""> | ||
<input type="submit" value="Submit Change"> | ||
</form> | ||
</div> | ||
</div> | ||
</section> | ||
<!-- //sign in form --> | ||
<!--footer section start--> | ||
<footer> | ||
<div class="agileits-footer-bottom text-center"> | ||
<div class="container"> | ||
<div class="w3-footer-logo"> | ||
<h1><a href="index.php"><span>UB</span>TRADE</a></h1> | ||
</div> | ||
<div class="copyrights"> | ||
<p> Design by <label> CSE_442_TEAM</label></p> | ||
</div> | ||
<div class="clearfix"></div> | ||
</div> | ||
</div> | ||
</footer> | ||
<!--footer section end--> | ||
|
||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters