Query string |
[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!
[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.
[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!
[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.
[eluser]WanWizard[/eluser]
Why not Code: <?php Which allows you to use $_GET['transaction_id'], and it saves you a redirect. |
Welcome Guest, Not a member yet? Register Sign In |