niclake
niclake

Reputation: 134

PHP - URL variables captured and passed to next page

Right now, I have a page that loads with a bunch of information from PayPal after a payment. I need to capture 5 of those pieces of information (payer_id, amount, payment_type, payment_status, and custom) and store them in order to have the following page load event be able to interact with that data. (This site is done using CodeIgniter.)

Assuming I use a $_GET, but I'm getting a little lost with this. Anyone able to help?

Example URL: http://example.com/page3.php?payer_id=8675309&amount=300&payment_type=instant&payment_status=complete&custom=182&...

FOR CLARITY: I want to extract the variables I'm after from the URL, assign them somewhere, and then I'll call them from my function to store them in the DB. I can't do this on page load, so I have to do it afterwards.

Upvotes: 0

Views: 63

Answers (1)

Ghazanfar Mir
Ghazanfar Mir

Reputation: 3543

May be this is what you need?

$payer_id = $this->input->get('payer_id');

Simply change parameter name (payer_id, amount, payment_type, payment_status, and custom) to retrieve its value

You would need to enable following in congif.php

$config['allow_get_array']      = TRUE; 

HINT: http://ellislab.com/codeigniter/user-guide/libraries/input.html

Upvotes: 1

Related Questions