Site built on Code Igniter framework. I have two links (like and dislike). When you click the link, the correspond value increases or decreases. You can see the site: http://joke.guluzade.com/jokes/view/24What I want: That user can change this value only once. I do it by cookies. For example, if user click to "like" link the value +5 became +6. Then if you click "dislike" the value must not change. User should have only one chance to like or dislike. Now it doesn't work correctly, if you click like you are able to click dislike too, but I want only change the lie or dislike value only one time.How I do: I check if the cookie is set, function does nothing, if not it sets cookie and changes value. But if cookie set for like, when you click dislike it doesn't see that cookie.Here is code:\[code\]function vote ($mm, $id){ //get the parameters (like or dislike and id) $name = $mm; $value = http://stackoverflow.com/questions/10546478/(int)$id; $time = time()+3600; if(isset($_COOKIE[$value])){ redirect($_SERVER['HTTP_REFERER']); } else { SetCookie($value, $name, $time); if($name == "like"){ $this->db->select('like'); $this->db->where('id', $id); $query = $this->db->get('jokes'); $data = http://stackoverflow.com/questions/10546478/$query->row_array(); $likes = $data['like']; $likes++; $dd = array(); $dd['like'] = $likes; $this->db->where('id', $id); $this->db->update('jokes', $dd); redirect($_SERVER['HTTP_REFERER']); } else { $this->db->select('dislike'); $this->db->where('id', $id); $query = $this->db->get('jokes'); $data = http://stackoverflow.com/questions/10546478/$query->row_array(); $likes = $data['dislike']; $likes--; $dd = array(); $dd['dislike'] = $likes; $this->db->where('id', $id); $this->db->update('jokes', $dd); redirect($_SERVER['HTTP_REFERER']); } }}\[/code\]Can anybody say, what I do wrong?