简体   繁体   中英

how to pass variable in url in codeigniter

I am integrating instamojo payment gateway in website.i am using codeigniter framework.

I passed redirect URL as

http://localhost/example/instapayment/redirect

So i get response as follow:

http://localhost/example/instapayment/redirect?payment_id=MOJO612323222&status=success

i am redirecting to base_url. My route is

$route['redirect/(:any)'] = 'instapayment/redirect/$1';

Now i am not getting how to access status and payment_id.

if you have to pass the value you should enter url like this

localhost/yoururl/index.php/products_controller/delete_controller/70

and in controller function you can read like this

function delete_controller( $product_id = NULL ) {
 echo $product_id;
}

http://localhost/example/instapayment/redirect?payment_id=MOJO612323222&status=success

if passing the variable in url that is bad practice , still if u want this u can use

$this->input->post() //for post menthod

$this->input->get() // for get method

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM