2
とSHA 512ハッシュ実装しますlandingpage.php私は、コントローラを持ってCodeIgniterの
<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
class LandingPage extends CI_Controller {
public function index(){
$data = array(
'head' => $this->load->view('Landing_Header', '', true),
'guts' => $this->load->view('Landing_Guts', '', true),
'foot' => $this->load->view('Landing_Footer', '', true)
);
$this->load->view('index', $data);
}
public function validateInput(){
#load help libraries for use
$this->load->helper("form");
$this->load->helper("form_validation");
/////////////////////////////////////////////////////////////////
/////////////////////// New User Validation /////////////////////
/////////////////////// Format for Validation : ////////////////
////////// "field name","Error Value","validation method" ///////
$this->form_validation->set_rules('fullname','Your Name','required|min_length[2]|max_length[20]');
$this->form_validation->set_rules('email','Your Email','required|valid_email|is_unique[users.email]');
$this->form_validation->set_rules('emailConf','Email Confirm','required|matches[email]');
$this->form_validation->set_rules('password','Password','required|min_length[2]|max_length[20]');
}
}
を私はこのexept、私は私が手続き私のアプリをしていたとき、前に持っていたようハッシングSHA 512を実装する方法を疑問に思いましたCODEIGNITERでの時間?
isset($_POST['password'])
$dynamSalt = mt_rand(20,100);
$userPassword = hash('sha512',$dynamSalt.$userPassword);
コードイグナイタにはこの機能が組み込まれていますか?何か似たようなもの?
本当です。ありがとうMadmartigan! – CodeTalk
コードイグナイター '$ this-> form_validation'呼び出しでこれをどうすればできますか? – CodeTalk
コールバック:http://codeigniter.com/user_guide/libraries/form_validation.html#callbacks –