Anchor Tag automatically calling href Without Click in Codeiginitor

1121 views php

Here in My View:

<div class="dropdown">
<button class="btn dropdown-toggle" type="button" data- toggle="dropdown">Dropdown Example
<span class="caret"></span></button>
<ul class="dropdown-menu">
foreach($site as $sites)
echo '<li ><a href="'.redirect(base_url().'shop/viewSiteId',$sites->site_id).'">"'.$sites->site_title.'"</a> </li>';

i want to redirect when user click on $sites->site_title but how it working is it automatically redirects to url

answered question

1 Answer


u can use echo "

  • site_id."'>".$sites->site_title."
  • "; and get that id by using GET method

    posted this

    Have an answer?


    Please login first before posting an answer.