json_md5_codeigniter /application/controllers/md5.php

Language PHP Lines 39
MD5 Hash 0830ff6f01dae5e65ac5b1ceeaf95d38
Repository https://github.com/bolnikh/json_md5_codeigniter.git View Raw File View Project SPDX
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Md5 extends CI_Controller {

	public function index()
	{
		$this->encode();
	}

    public function encode() {

        $this->load->library('form_validation');

        $this->form_validation->set_rules('data', 'Данные', 'required|xss_clean');

        $data = array();
        $data['page_title'] = 'MD5 encode, MD5 хеш';
        if ($this->form_validation->run() == FALSE)
        {
            $data['result'] = '';
        }
        else
        {
            $data['result'] = md5($this->input->post('data'));
        }
        $this->load->view('md5/encode', $data);
    }

    public function file() {

        $data = array();
        $data['page_title'] = 'MD5 encode file, MD5 хеш файла';
        $data['result'] = @$_FILES['data'] ? md5_file($_FILES['data']['tmp_name']) : '';

        $this->load->view('md5/file', $data);
    }
}
Back to Top