Gifari Industries - BD Cyber Security Team
Home
/
home
/
decohaslibrary
/
studentrecruitment.decohaslibrary.ac.tz
/
✏️
Editing: resetpassword.php
<?php include('conn.php'); if(ISSET($_POST['save'])){ if($_POST['password'] != "" || $_POST['$regno'] != ""){ try{ $password = md5(addslashes($_POST['password'])); $regno = addslashes($_POST['regno']); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql1= "UPDATE `student` SET password='$password' WHERE regno='$regno'"; $conn->exec($sql1); }catch(PDOException $e){ echo "<script>alert('Invalid Reg No')</script><script>window.location = 'index.php'</script>"; } $_SESSION['username']=array("text"=>"Applicant successfully Confirmedd.","alert"=>"info"); $conn = null; header('location:index.php'); }else{ echo " <script>alert('Please fill up the required field!')</script> <script>window.location = 'index.php'</script> "; } } ?> <!DOCTYPE html> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" name="viewport" content="width=device-width"/> <link rel="stylesheet" type="text/css" href="css/bootstrap.css"/> </head> <table border="1" cellspacing="5" cellpadding="5" width="100%"> <h2 style="font:strong">Reset your Password</h2> <form action="resetpassword.php" method="POST" enctype="multipart/form-data"> <div class="modal-content"> <div class="modal-body"> <div class="col-md-2"></div> <div class="col-md-8"> <div class="form-group"> <div class="form-group"> <label>Enter Your Registration No</label> <input type="text" class="form-control" name="regno" required> </div> <div class="form-group"> <label>New Password</label> <input type="text" class="form-control" name="password" required> </div> </div> </div> </div> <div style="clear:both;"></div> <div class="modal-footer"> <a href="index.php"><button type="button" class="btn btn-danger" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span> Close</button></a> <button name="save" class="btn btn-primary"><span class="glyphicon glyphicon-save"></span>Reset</button> </div> </div> </form> </body>
💾 Save
❌ Cancel