Forum Moderators: open

Message Too Old, No Replies

Restricted access to a web page

         

ggranade2

9:04 pm on Feb 27, 2006 (gmt 0)

10+ Year Member



I'd like to set up a page which cannot be accessed by anyone at any time except for in one particular situation, and that is: if a user clicks on one specific link.

What's I'm trying to do is set up something like I-tunes Music Store, where visitors to a page would be able to pay money to buy a song which they could then download. Obviously not just anyone should be able to access the URL with the song on it because it would defeat the purpose of people paying for the music.

I have the possibility of setting up payments with Paypal, and Paypal does offer the option of referring successful payers to a page notifying them of the successful transaction, which could be the page with the link to the song on it. I just wouldn't want anyone to be able to access that particular URL except for someone who has just paid for the song with Paypal and been sent to the successful transaction page.

Is there any way to set this kind of thing up? I've tried talking with my hosting service about restricting access to certain pages, but they seemed to think it was a programming / HTML issue.

Thanks a lot,
George

zacheos

12:56 am on Feb 28, 2006 (gmt 0)

10+ Year Member



The only way to do what you are trying to do is using server side programming to verify the referrer on the fly. There is no simple HTML method of doing this.

encyclo

2:22 am on Feb 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to the forums ggranade2! Effectively there is nothing in straight HTML which will do what you want, and what's more merely depending on the HTTP referer header is not sufficient either as some browsers or security software don't sent the header at all, whereas in others the header can be easily faked.

You will need to either assign a unique URL for each download, or place a cookie or method of login for registered (paid up) members to the site. It all depends on what your precise needs are.

What server-side programming languages are available on your server?

ggranade2

4:24 pm on Feb 28, 2006 (gmt 0)

10+ Year Member



Hi, thanks for everyone's help! This problem is definitely a bit beyond my abilities.

PHP is available on my server. As far as I can tell, that is the only server-side programming language there.

George