![]() |
Query string - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Query string (/showthread.php?tid=33118) |
Query string - El Forum - 08-16-2010 [eluser]Philo01[/eluser] Hi there! I have a problem. I am currently building a webshop using CodeIgniter and the payment gateway returns a query string on successful payment like: (Using mod_rewrite for .html) Code: http://www.mydomain.com/order/paid.html?transaction_id=a1b2c3 I would like it to be like: Code: http://www.mydomain.com/order/paid/a1b2c3.html This is an invalid url for CI, and I don't want to enable the query string option. Does anyone know a solution for this? Maybe with .htaccess? Thanks! Query string - El Forum - 08-16-2010 [eluser]mddd[/eluser] You could make a simple script: Code: // redirection from payment gateway Set your payment gateway to refer to this script (e.g. www.mydomain.com/scripts/paid.php). That's it. The simple php script redirects to your CI script. Also, it is not very difficult to let CI accept $_GET variables and then you could just have the payment gateway send their response directly to your CI page. Query string - El Forum - 08-16-2010 [eluser]Philo01[/eluser] [quote author="mddd" date="1281990497"]You could make a simple script: Code: // redirection from payment gateway Set your payment gateway to refer to this script (e.g. www.mydomain.com/scripts/paid.php). That's it. The simple php script redirects to your CI script. Also, it is not very difficult to let CI accept $_GET variables and then you could just have the payment gateway send their response directly to your CI page.[/quote] Nice one! Thanks! ![]() Query string - El Forum - 08-16-2010 [eluser]mddd[/eluser] You're welcome. It's not the most elegant solution (as would be keeping everything inside CI) but sometimes it's just easy to build a very simple thing, I think. Query string - El Forum - 08-16-2010 [eluser]WanWizard[/eluser] Why not Code: <?php Which allows you to use $_GET['transaction_id'], and it saves you a redirect. |