I’m trying to make a password-protected page for my client’s website, which exists to showcase her artwork and allow people to buy any of it using PayPal. The protected page will serve to feature some of her work that most people may find offensive, and she only wants it to be viewed by people she gives the password to. Of course it would be easier to just not link to the page from the website and give people the direct URL instead, but I guess that wouldn’t be as fancy.
Obviously I used a basic IF statement to check if the password is correct, but the problem is with PayPal. When I click the “Add to cart” button below any of the items and I’m brought to the shopping cart on PayPal, then click the button that says “Continue shopping”, it brings me back to the page and I have to enter the password all over again.
Here’s what I’ve come up with, to no avail:
[php]if($_POST[‘password’]==“blahblahblah” || strpos($_SERVER[‘HTTP_REFERER’], “https://www.paypal.com/”) !== FALSE) {
Display content.
} else {
Display error message.
}[/php]
Any ideas?