How to pass multiple parameters in window. location – Codeigniter

  codeigniter, jquery, redirect
    $product_id=base64_encode($row->projects_id);
<input class="btn btn-success" type="submit" name="submit" value="View Details" onclick="window.location='<?php echo site_url("index.php/Project_single")?>?product=<?php echo $product_id;?>' ">

I am passing a variable ‘product’ like above & retrieving it successfully inside a function in another page as shown below.

 public function index()
    {
        $product_id = base64_decode($this->input->get('product'));
        $res = $this->Project_single_model->get_productdetails($product_id);
    }

I need to pass the same value through the above given ‘submit button’ to an another function:

public function displayissues()
    {
        //$product_id = base64_decode($this->input->get('project'));
        $result['res'] = $this->Project_single_model->display($product_id);
    }

Both the index() & displayissues() resides in the same page.
And I have tried passing 2 parameters like below.

$product_id=base64_encode($row->projects_id);
$project_id=base64_encode($row->projects_id);
<input class="btn btn-success" type="submit" name="submit" value="View Details" onclick="window.location='<?php echo site_url("index.php/Project_single")?>?product=<?php echo $product_id;?>','<?php echo site_url("index.php/Project_single/displayissues")?>?project=<?php echo $project_id;?>' ">

But I am not able to get the value passed in variable ‘project’ in the 2nd function. Please tell me how can I accomplish this?

Source: Ask Javascript Questions

LEAVE A COMMENT