Asked by: falak
password_reset.blade.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
<title>Reset Password</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<link href="css/ie10-viewport-bug-workaround.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/reset-possword.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="row">
<div id="passwordreset" style="margin-top:50px" class="mainbox col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2">
<img src="images/logo_greenbase.png" alt="" class="logo center-block">
<div class="panel panel-info">
<div class="panel-heading">
<div class="panel-title">Reset Password</div>
</div>
<div class="panel-body">
<form method="POST" action="/users/password" id="contact_form" class="contact-form custm-form" role="form"
enctype="multipart/form-data">
{{-- <div class="form-group">
<label for="email" class=" control-label col-sm-3">Email</label>
<div class="col-sm-9">
<input type="email" class="form-control" name="email" value="">
</div>
</div>--}}
<div class="form-group">
<label for="email" class=" control-label col-sm-3">New password</label>
<div class="col-sm-9">
<input type="password" class="form-control" name="password" placeholder="create your new password">
</div>
</div>
<div class="form-group">
<label for="email" class=" control-label col-sm-3">Confirm password</label>
<div class="col-sm-9">
<input type="password" class="form-control" name="confirmation_password" placeholder="confirm your new password">
</div>
</div>
<div class="form-group">
<!-- Button -->
<div class=" col-sm-offset-3 col-sm-9">
<input id="btn-signup" type="submit" class="btn btn-primary" value="submit">
</div>
</div>
</form>
</div>
</div>
</div>
</div><!-- /.row -->
</div><!-- /.container -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/jquery.min.js"><\/script>')</script>
<script src="js/bootstrap.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="js/ie10-viewport-bug-workaround.js"></script>
</body>
</html>
usercontroller.php
public function password_submit(Request $request)
{
$password=$request->get('password');
$confirmation_password=$request->get('confirmation_password');
$validator = Validator::make(array('password' => $password,'confirmation_password'=>$confirmation_password), array('password' => 'required','confirmation_password'=>'required'));
if ($validator->fails()) {
$this->_response->status = 'INVALID_PARAMS';
$this->_response->message = array_flatten($validator->errors()->getMessages());
}
else {
if ($password == $confirmation_password) {
$result = $this->_model->update_passsword($email,$password,$username);
}
else {
$this->_response->status = 'FAILURE';
$this->_response->message = 'Password Not Match';
}
}
}
routes define in web.php
$app->post('users/password', 'UserController@password_submit');
this problem is in lumen micro framework ,i am working on password recovery. i am submitting password and confirmation password in form ..how i define action in form in lumen ??
No comments:
Post a Comment