Monday 27 June 2016

LOGIC SHOW ORIGINAL PASSWORD


"every master were newbie"


to be honest i'm not master at all cause still need learn new thingslah, the reason why i give a quote above that becuase someone asking what i had asked when i was new bie in programming, screen shot in bellow here 



if you know what is md5 you are good but for spesific answer your better googling, but if you are  as developer need to show the original password why you don't create 2 variable post
  1. Frist post with md5
  2. Second post dont use md5 

This bellow about see what password users input, by the way i use codeigniter framework

<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Welcome extends CI_Controller {

  
 public function index()
 {
  $this->load->view('welcome_message');
 }
 
 public function action()
 {
  echo md5($this->input->post('password')); //this is encrypt
  echo "<br>";
  echo $this->input->post('password'); //not encrypt
 }
}

This is the form

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>
<html lang="en">
<head>
 <meta charset="utf-8">
 <title>Welcome to CodeIgniter</title>

 <style type="text/css">

 ::selection { background-color: #E13300; color: white; }
 ::-moz-selection { background-color: #E13300; color: white; }

 body {
  background-color: #fff;
  margin: 40px;
  font: 13px/20px normal Helvetica, Arial, sans-serif;
  color: #4F5155;
 }

 a {
  color: #003399;
  background-color: transparent;
  font-weight: normal;
 }

 h1 {
  color: #444;
  background-color: transparent;
  border-bottom: 1px solid #D0D0D0;
  font-size: 19px;
  font-weight: normal;
  margin: 0 0 14px 0;
  padding: 14px 15px 10px 15px;
 }

 code {
  font-family: Consolas, Monaco, Courier New, Courier, monospace;
  font-size: 12px;
  background-color: #f9f9f9;
  border: 1px solid #D0D0D0;
  color: #002166;
  display: block;
  margin: 14px 0 14px 0;
  padding: 12px 10px 12px 10px;
 }

 #body {
  margin: 0 15px 0 15px;
 }

 p.footer {
  text-align: right;
  font-size: 11px;
  border-top: 1px solid #D0D0D0;
  line-height: 32px;
  padding: 0 10px 0 10px;
  margin: 20px 0 0 0;
 }

 #container {
  margin: 10px;
  border: 1px solid #D0D0D0;
  box-shadow: 0 0 8px #D0D0D0;
 }
 </style>
</head>
<body>

<div id="container">
 <h1>SEE PASSWORD</h1>

  <form action="<?php echo site_url('welcome/action')?>" method="post">
  Password: <input type="password" name="password"><br>
 
  <input type="submit">
  </form>


 
 </div>

</body>
</html>

You can see what the script tell in this image bellow















Thanks for your time,

No comments:

Post a Comment