View Full Version : Not sure what this is called...
george-
02-15-2009, 01:15 PM
Hello,
I'm not sure exactly what this is called but here's the deal:
I need a page that "runs out" after the user views it. Basically, they are redirected to this page after they've payed, a username/password will generated there, and they will be registered to the site.
My problem is, I can't have this page viewable by just anyone. I don't want them to be able to copy the URL and come back, or give it to their friends for free registration/access. I want the URL to "run out", so to speak.
How can I go about doing this? I'm familiar with PHP but I'm only basic. I don't know anything on ASP or other web languages.
Thanks to anyone that can help. :)
You can have PHP set a session:
Redirect page:
<?php
session_start();
//some how figure out if they're paying
$_SESSION['payed'] = true;
header('Location: paying.php');
//end some how figure out if they're paying
?>
Then on the paying page:
<?php
session_start();
if(isset($_SESSION['payed']) && $_SESSION['payed']){
echo "You've payed!";
}
?>
george-
02-15-2009, 02:16 PM
Hello Nile, thank you for replying so quickly.
I'm not sure if I'm going to be able to do what you have suggested though. I am using PayPal as the payment method and the redirect and payment pages are not mine to edit.
Is there any way I can use htaccess to allow only those who have come from PayPal to access the page? or is there a better method?
I have attached a jpg which more accurately describes the process I need.
Thank you. :)
Hmm, on the page that your paying from, I think that paypal gives you the option to send POST data along with the thanks page, am I correct?
Medyman
02-15-2009, 11:23 PM
Are you using a PayPal Merchant account? If so, you don't have to bother with any of this (unless you want to). PayPal takes care of it all for you.
You should read more about instant payment notification (https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/howto_html_instantpaymentnotif)(IPN). You might also find useful information at PayPal's IPN forum (http://www.pdncommunity.com/pdn/board?board.id=ipn).
george-
02-15-2009, 11:29 PM
Hi Nile,
I don't think that method will work as there are only a certain number of custom PayPal variables that can be posted. Would I be able to start a session from a POST?
Is there any way I can achieve this:
1. User enters thank you page.
2. Username/Password generated (done this, with the help of Schmoopy)
3. If user points to another page, coming back will cause "page has expired". Also if they press refresh it will have to expire.
4. Hide/encrypt the URL so it can't be copied & pasted to other people.
Sorry if I seem a little ignorant here :), as I'm pretty sure the URL thing isn't as simple as I'm thinking, or the page expiration...
:)
george-
02-15-2009, 11:36 PM
Hi Medyman,
I was using IPN before, but I have some affiliate tracking software installed also, which to be successful requires the users to be sent to the thank you page.
PayPal generates usernames and passwords for you but it isn't compatible with auto return, so I can't guarantee the users will ever end up on the thank you page and be registered as a referall by the affiliate tracking software I have.
This way still isn't foolproof, but users are not likely close the page until they have their username and password (as they have just payed for it).
:)
You can't encrypt the url, but you can encrpy an extension using PHP.
Medyman
02-17-2009, 07:01 PM
Hi Medyman,
I was using IPN before, but I have some affiliate tracking software installed also, which to be successful requires the users to be sent to the thank you page.
PayPal generates usernames and passwords for you but it isn't compatible with auto return, so I can't guarantee the users will ever end up on the thank you page and be registered as a referall by the affiliate tracking software I have.
This way still isn't foolproof, but users are not likely close the page until they have their username and password (as they have just payed for it).
:)
So, use IPN with auto-return and generate the usernames yourself.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.