0

控制器:

function verifyuser()
{
    $uri = $this->uri->uri_to_assoc(4);
    //print_r($uri);
    if( isset( $uri['id'] ) && $uri['id'] != '' )

            {
            $where = array();
                $where['roll_number'] = $uri['id']; 
$this->data['verification'] = $this->admin_model->verify($where);


        }
        else
        {
        $this->data['verification'] = array();

        }
    $this->data['content'] = 'admin/verification';
    $this->view($this->data);   
}

模型:

function verify($where='')

{
  $this->db->select('*');
$this->db->from( $this->db->dbprefix('members') );
if( !(empty( $where )) )
$this->db->where( $where );


$result = $this->db->get();
//echo $this->db->last_query();
    return $result->result();

}

www.example.com/user/admin/verify/ 345

www.example.com/user/admin/verify/ hgf_877%%%_oi

像这样。

4

1 回答 1

0

出于安全目的,您可以使用PHP.net手册中定义的任何编码。但我更喜欢 base64_encode 和 base64_decode。我正在使用我的应用程序来编码复杂的字符串。

<?php
$temp = 345;
$res = base64_encode($temp);
echo $res;echo "<br>";
$result = base64_decode($res);
echo $result;
?>

您也可以在此链接中找到小示例。

于 2013-02-12T16:07:25.803 回答