public function vote_add(){
$music_id = (int)$_POST["music_id"];
$this->load->model("model_music");
$music_exists = $this->model_music->select_music_exists($music_id);
if(isset($music_id,$this->session->userdata["id"]) && ($music_exists) && ($this->session->userdata("is_logged_in"))){
$user = $this->session->userdata["id"];
$previously_vote = $this->model_music->select_previously_vote($music_id,$user);
if($previously_vote === true){
echo "You alrealy vote this!";
}else{
$this->model_music->select_add_vote($music_id,$user);
echo 'success';
}
}else{
echo "You do not have access to this page.";
}
}
แต่ที่มันจะแสดงตอนนี้ ถ้าไม่ได้Loginมันจะเด้งPopup echo "You do not have access to this page."; พอใส่ ว่า echo redirect("login");
มันได้Popupแสดงโค๊ดของหน้าLoginครับ