Hello im looking for some kinda code,
you are paying for something on this page, then when you are done you come to another page.
thats not the problem, it come now.
this page you come to, it should only be able to open if you come from the paying site after you have payed.
fx. http://example.com/ you go pay (with paypal) when your done you get redirected to http://example.com//lol
but that site should only be able to open if you come from the paypal site.
else you can just say http://example.com//lol in your browser and you get it... thats not the meaning.
but i cant make it, so please help me.

Recommended Answers

All 13 Replies

If you have a PayPal account sign in to it and do some research. There is an option in PayPal that you can set up to redirect a customer to a page that you choose. Once the user lands on that page after payment you can have it set up that the script only executes if certain conditions exist. I'm not a big fan of working with payment gateways so someone else here may be better suited to answer this question in more detail, but that is my two cents.

hello, that is exactly what i need.
i cant just make the code that only execute from that page...
so please can someone create that code?

hi.. me too want to knw info abt this..

goto paypal developer site.. they give u free accounts to check this kind of transactions..

after a payment has been made in paypal a id wil be generated, check for this id on the landing page.. so u can validate the user.. if the id dosent exist , the user shud not be on the landing page...

i hope u understand.. coz.. this is wat i dug up..

plz let me know for better options.

smvec that is just like the first reply, that is exactly what i need.
but i still some kinda code that can validate the user.

me to searching for the code..

let me know if u find it before me..

Okay guys, here is what you are up against. What I would think you need firstly is an IPN (Instant Payment Notification) listener. What that does is (in a manner of speaking) is "talk" to PayPal when a user makes a transaction on your website. When a transaction occurs it writes certain pieces of information to the database like customer name, address, transaction amount, transaction id, etc. You can find an already made script on the net by googling "Free IPN Listener." You can write your own but it doesn't seem like you are in a position to be able to do that. Once you set up your PayPal account and implement a payment button on your site you can use PayPal's sandbox to test your listener and verify the information that is being passed to it and ensure it is working the way you want it to. Secondly, you should have your site set up where users need to log in and you can track them through sessions. Finding a code that validates your users based on a PayPal transaction may never happen. That is something you will need to write yourself. Once you have your payment gateway set up and know what info is being passed to the database upon a completed transaction you can use that info to verify the payment against your user base. Once you verify the user and the payment you can have your code execute at that time or die if the info doesn't match up. What you want to the code to do at that point is entirely up to you ... you can have it whistle Dixie if you want to, the possibilities are limitless. So, without having first hand knowledge of what kind of info you are tracking through your sessions, what kind of member info is recorded to the database, what kind of info is being passed through the IPN, and pretty much a multitude of other things, no one can write a code for you that will validate users and verify payments or do anything else for that matter. If you want to do something simpler just set up a page that shows a receipt and says "Thanks for your payment" then tell PayPal where to find that page once the payment has been completed and have your customers redirected there.

Wow man.. big kinda information..

some thing like this is wat im expecting..

now i hav a big size prob, of understanding it n writein the code..

thanks man..

will ask u for doubts in the upcoming days.. thanks again

CFROG, i know that is the most simple. (last 2 lines)
but why is need this is that when you have payed you should be able to download(musik)from a band i know.

You want to know that a user actually paid and did not just type in the URL to get to your landing page. When PayPal sends info to your IPN Listener it logs things like transaction id, first name, last name, transaction amount, email address, payment status (complete, pending, etc.). You can use that info and run it against your user base to make sure the user is valid and their payment status is complete. Once this info has been confirmed you can update the user's account and allow them access to download the music. It's all about validation. I'd imagine it would not be too difficult to manipulate the landing page and gain access without paying. An IPN Listener also verifies that the info being passed back and forth is valid. There are ways to manipulate data that is sent to back and forth for example changing the price of an item from $5.00 to $0.01. IPN listener will prevent that as well as a lot of other things. It will validate that the transaction is actually coming from PayPal and not someone trying to fool your site.

next question...
how do i make a user login to my site???
like you said they need to be able to login

omg... this is getting too much for my head....
just forget my question im closing the thread.

Try to google "php free log in script" . That should help you, It's a bit much for me to explain in here.

as i said...
forget it.

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.