Ultra-newbie and PHP extra-virgin here, with a grovelling apology if this is the wrong bit of the forum.
I'm building my new site in Dreamweaver, but I have a 'test' site up on Yola. The site is a pay-to-enter 'museum' and I'd like it to work like this...
Punter clicks on PayPal button, goes to Paypal and pays (a paltry sum).
Punter is taken to my 'Lobby' page from which he/she can access all the site's pages.
After a set time (say, 24 hours), the punter loses access to the site.
So here's what I'd like to have PHP do...
Paypal tells the site of the purchase.
I get a notification with the punter's info (e.g. who, where, when + mail address).
PHP uses the Paypal info to send a 'thanks for calling' e-mail.
Punter is taken to the Lobby page
He/she can swill about in the site but the timer's running, and blocks access after 24 hours.
This will become clear after a look at the test site. It's at www.dead-interesting.co.uk :crazy:
To get past the PayPal page for a look around, fill in the username value as 'admit' and the password as 'one'...(no quotes).
Just as an aside, I'm not a developer and so respond to the K.I.S.S. principle. I don't even know where PHP scripts go.
Be gentle with me :hush:
I'd have a look at the PayPal IPN documentation (Instant Payment Notification). At the point your user creates their account, you'd show a form with a button to submit to PayPal, await the IPN confirmation from their site, store the date/time in your user login database (to do the 24 hour thing) and continue to the protected content. So I'd picture:
Form to create account, like your current login form, but gets email address and whatever else you need. Submit button creates record in your users database with a blank 'activated' field.
Confirmation page displays a form to submit to PayPal which contains your PP details and a unique reference number. User presses button and is taken to PayPal site.
If the purchase is completed, PP returns user to your specified landing page which then sets the 'activated' date/time and continues.
But, I haven't looked at PayPal for a couple of years, so the above might be rubbish and there might be a new great way of doing it.
The picture becomes a little clearer and I believe it all still works the same way as ever at PayPal. The use of a cookie sent to the customer's machine (to do the 24-hr access job) was also mentioned. My search will continue
PS: You might find this interesting http://en.wikipedia.org/wiki/Gerry_Marshall