CIを初めて使用し、jsonエンコード値を渡してさらに処理するために表示したい場合は、以下を参照してください。
Jqueryの投稿:
$('#btn_reset_password').click(function(){
    var parameters = $('#reset_password_form').serialize();
    //alert(parameters);
    $.ajax({
        url: baseurl + 'site/check_email_exist',
        type: 'POST',
        data: parameters,
        dataType: 'json',
        success: function(output_str){
            if(output_str.flag == "true"){
                // redirect to change password page
                window.location.replace(baseurl + 'site/change_user_password');
            }else if(output_str == "false"){
                $('#result_msg').html("Your email is not in our database");
            }else{
                $('#result_msg').html(output_str);  
            }
        }
    });
});
コントローラ:
class Site extends CI_Controller {
public function change_user_password() {
    $this->load->view('header');
    $this->load->view('change_user_password');
    $this->load->view('footer');
}
public function check_email_exist(){
    $email = $this->input->post('email');
    if(!empty($email)){
        $query = $this->db->query('SELECT * FROM users WHERE email="'.$email.'"');
        if($query->num_rows() > 0){
            $row = $query->row();
            $output_str = array('email' => $row->email,
                                'flag' => 'true'
                                );
            //$this->load->view('change_user_password', $output_str);
            //$output_str = "true";
        }else{
            $output_str = "false";
        }
    }else{
        $output_str = "Email cannot leave blank";
    }
    echo json_encode($output_str);
}
}
ファイル'change_user_password.php'を表示します:
<?php 
//$obj = json_decode($output_str);
echo $email;
?>
<p><div id="result_msg"></div></p>
<p>
<form id="reset_password_form">
<label><b>New Password: </b></label>
<input type="password" name="new_password" style="width:250px;" />
<input type="button" id="btn_change" name="" value="Change" /><br />
</form>
</p>
配列$output_strにある電子メール値を渡して取得して'change_user_password.php'を表示するにはどうすればよいですか?私は多くの方法を試しましたが、それでもこの問題を解決することはできませんでした。助けてくれてありがとう。
追加した:
Codeigniterはこの方法でURLパスパラメータを受け入れることができませんでした=>page?email = abc@xyz.com?