Hi all,

I'm emailing from the land of Oz ..... it appears that the developers of this site also have connections with the land of Oz.

I'm writing because I have created a fool proof Excel timesheet calculator which I'd like my customers to subscribe to (through PayPal) before having permission to register with my site in order to access the spreadsheets.

I have a PHP registration and login script (feeding into a mysql database) which I reasonably happy with however, I do want to make further enhancements to it so it can do several things:

1. Not allow customers to register on the login page;
2. Have up to five security levels to automatically direct customers to their chosen subscribed spreadsheet);
3. Auto emailer to myself and customers (including forgot password); and
4. Script that can be easily integrated into my exciting page format and graphics.

As mentioned, I do have one that I'm reasonably happy with, but it is very basic. Any suggestions would be greatly appreciated.

Kind regards,

Steve

Dani AI

Generated

Good brief. Below is a concrete, modern approach tying together the ideas from and so the PayPal gating, role redirects, emailing and theming all behave reliably and securely.

For payment gating: use a server-to-server notification from the payment provider to create or flag a "paid" record in your DB, then allow registration or send a one-time activation link. An alternative is to sell redeemable license codes (one code = one subscription level) that the buyer redeems during registration. In either case record: transaction id, buyer email, subscription_level (1–5), start/end dates and status so you can handle refunds or expiries later.

Permissions and redirects: store a numeric subscription_level in users. Keep a lookup table mapping levels to spreadsheet IDs or protected paths. After login set the level in the server session and always check it server-side before serving a file or redirecting. Never expose direct file URLs; serve spreadsheets from outside the webroot or stream them through a checked PHP endpoint so unauthorized requests fail.

Email, password and automation: use an SMTP-capable mailer (with TLS) for reliable delivery. Send purchase receipts, registration confirmations and password-reset links. Implement password resets with single-use, time-limited tokens (store token hashes, expire quickly) and rate-limit requests. Use password_hash/password_verify (or equivalent modern hashing) and parameterized queries (PDO or mysqli prepared statements).

Integration and ops: separate presentation (header/footer templates) from logic, use Composer to manage libraries, test flows in the payment sandbox, and log IPN/webhook events for troubleshooting. Vet any third-party scripts you find (as suggested) and follow ’s lead on using an ACL-style approach—just ensure the ACL stores roles and resources in the DB so it stays flexible.

Recommended Answers

All 4 Replies

Hi Steve and welcome to Daniweb,

Good to see another fellow Australian in the mix. I can offer some advice for numbers 2 and 3...

For 2, take a look at the GACL package, which is a very powerful tool that deals with security and permission levels for your site.

For 3, something like PHP Mailer is a good package that allows you to send emails in the way that you want.

Hope this helps,
darkagn

Hi Darkagn,

Thanks for the quick response. I will take a closer look at that script tonight.

Kind regards,

Steve

You can also grab some great solutions from phpclasses.org. Just search through the thousands of scripts. They almost always have a sample page or two for illustration and testing.

Hi Kness,

I will have a look. I have offered to give a donation but even that doesn't appear to be a enough incentive.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.