php - How to send Data form view to controller through URL in codeigniter and how i get data in controller -


how send data form view controller through url in codeigniter , how data in controller?

<div class="col-md-3 col-md-3-text"> <div class="classwithpad"><img src="<?php echo base_url(); echo 'assets/img/'; echo $title[$i]->image; ?>"/> <?php $id = $title[$i]->category_id; ?>              <div class="title_banner"><a href="<?php echo site_url('welcome/category','' ) ?>" class="mhover"><?php echo $title[$i]->category_name; ?></a></div>             </div>       </div> 

send this

you have use $_get[] method of php:

<a href="<?php echo base_url()?>your_controller/your_function?id=1">my data</a> 

this redirect controller had function , within your_function have use $_get['id']

function your_function() {     $id = $this->input->get('id'); } 

Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -