Using a script with paypal to generate usernames/passwords

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Vitalization
Forum Newbie
Posts: 2
Joined: Sun Aug 01, 2010 2:38 am

Using a script with paypal to generate usernames/passwords

Post by Vitalization »

Hey, I own an eBook that people purchase and I have to manually give them a username and password for them to login to it. I then have to e-mail them their account details manually.
I know that some websites like Adobe send you a message through email as soon as you pay online. I use paypal and I'm not sure if it is possible to have a system which generates a username and password and then sends them an e-mail with those account details AND writes these usernames/passwords to a text file. Paypal gives you an option for redirecting the user to a custom "thank you" page, you specify the URL.... i was thinking maybe this thank you page could be some kind of script (php file) which does all of which i described above.

Is this possible?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Using a script with paypal to generate usernames/passwor

Post by requinix »

The method you're thinking of is insecure. Someone could click whatever link/button you use to send them to PayPal, grab the return URL, and visit it manually.
PayPal offers an IPN service that calls your server when a payment goes through. That's where you'd want to put this kind of stuff.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Re: Using a script with paypal to generate usernames/passwor

Post by superdezign »

Though, it is possible to make a link like that valid the first time it is visited, and never again.
Vitalization
Forum Newbie
Posts: 2
Joined: Sun Aug 01, 2010 2:38 am

Re: Using a script with paypal to generate usernames/passwor

Post by Vitalization »

ive been researching the Paypal IPN and ive realized that what i would want to do for now is when the user pays for the item it generates them a username/password and sends this information into a table in my MySQL database after validating the transaction. There is an IPN script called "Password Management" but there isnt really a solid guide that will help me to find the correct scripts needed for the files (.htpassword and processed_txns) any help to finding these scripts would be great. (Im also searching for paypal.pl)
Post Reply