I’m using a Paypal Lib for CI–On success, it returns to the “success” page that says “thanks!”, and it adds 1 credit for the user. The problem is, the page “success” is accessable at any time.
How can I make this page inaccessible, but still functional?
I’m a CI noob! Thanks for the help!
In the controller method that serves up the “success” view you could wrap the success actions (adding +1 credit, etc.) and the loading of the “success” view in a conditional to see that one of the variables set by the PayPal library, after a successful purchase, exists.
If it doesn’t exist you can just call:
(be sure you’re loading the URL Helper first)
Which will send the user to the site’s base_url as-defined in your application/config/config.php file.
Here is an example (specific to your library, I believe):