Anchor Tag automatically calling href Without Click in Codeiginitor

1121 views php
0

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">
<?php 
foreach($site as $sites)
{
echo '<li ><a href="'.redirect(base_url().'shop/viewSiteId',$sites->site_id).'">"'.$sites->site_title.'"</a> </li>';
}
?>
</ul>
</div>
<?php 
}
?>

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

7

u can use echo "

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

    posted this

    Have an answer?

    JD

    Please login first before posting an answer.