[eluser]Unknown[/eluser]
Hello all,
I don't know what the problem is. I have an ajax which sends username to the controller:
Code:
function my_profile(username){
$.ajax({
url: "member/my_profile",
type: "get",
data: "username="+username,
success: function(){
windowdotlocation.href = 'member/my_profile';
}
});
}
And this is my controller:
Code:
function my_profile(){
$username = $this->input->get('username');
$data['username'] = $username;
$this->load->view('my_profile' , $data);
}
I have already echo the $username to test that it can alert(msg) from the ajax. It works just find. Problem is nothing is shown in my view:
Code:
<h1>My Profile</h1>
<?php
echo $username;
?>
I don't know why. I tried initialized $data['username'] = 'adam' and this works.