one time visit to the page

I want to set up a page with PayPal subscription gate away to my members area. It's a simple page with PayPal button which offer discounted subscription price for the chosen customers only.

Therefore I want to give one time access to it. So when the visitor leaves the page to go to PayPal to start subscription and then return to the page - access will be denied. The new access will be denied even if he/she do not subscribe. In short, it is one time visit. This will stop them spreading this offer all over the net.

Would appreciate if you provide the code or plugin for this. Thanks

Topic members timestamp accessibility links pages Wordpress

Category Web


Although this is not a WP question, it could be done with some PHP/MySQL code. Just the psuedocode:

  • generate a GUID value on each main page visit
  • check if the GUID is already in the GUID database
  • if not, store the GUID in the GUID database
  • if GUID exists in the database, redirect to another page ("you were already here, only one per customer" message)

This requires a GUID database that you get to build. And all of the PHP/MySQL code to implement.

Then, create a template from your theme (and a Child Theme to put it in). Add the code to check/store the GUID to that template.

You could also make it into a plugin, where the plugin checks for the page-id of the page you want to limit, so the plugin only runs on the specific page.

But, again, this is not a WP Development question. You'll have to build it yourself. But it can be done. My approach is only one way; there are probably others discoverable via the googles (or bings or ducks).

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.