View Full Version : 1 pay 1 game

12-13-2009, 09:36 PM
I have a game page on my site and I am trying to protect direct access to it by .htaccess .htpasswd but is not accepting user name and password?


AuthUserFile /home/vhosts/kandcoentertainment.freetzi.com/.htpasswd
AuthType Basic
AuthName "game1"

<Files "cookietest.html">
Require valid-user



Any suggestions on why it is not working?

What I would like to do is have apay and play once setup but as I am a novice and dont have a clue HELP PLEASE!!!

What I have been told is - protect the files, add a client side cookie to game page then upon url payment return validate cookie giving single access and when played the user cannot replay by refresh or just typing in url because cookie expired ? I have tried to write the scripts up with no success.

hire programmer
12-14-2009, 12:45 PM
Will you pay to fix it up ?

12-14-2009, 12:48 PM
That's not in the essence of this forum hire_programmer. We give help without the expectation fo payment.

12-14-2009, 12:59 PM


Any suggestions on why it is not working? Is that your actual password? If so, you'd need to generate a new .htpasswd file using the program given by apache, since this login system expects an encrypted password(AFAIK). You could see the executable/program in your /apache/bin directory (in my xampp system, it's htpasswd.exe).

12-17-2009, 12:16 AM
Thanks. Firstly my host gave me the wrong path to .htpasswrd and yes I think I needed to encrypt the password?. Any way I finally got it last night. Now I need to add a cookie validation script to .htaccess? and to my paypal on payment complete actions with return url to the game page where I believe I need to validate the client side cookie. Also can I set expire 0 to cookie allowing no more access like key f5/refresh page. Does anyone know of a easy script or an even easier alternate way. Much Thanks Il.

12-17-2009, 06:03 AM
if people are paying for a service you are providing them with i would suggest using a more stable system than cookies which the user can disable/delete and i personally would go with a mysql database for this since it is more secure

12-17-2009, 07:37 PM
Local DB=Definitely more secure.

Also to think about, if people are paying, your game fails to load ... your setup will need to be able to recognize that. Otherwise you'll probably get all sorts of calls from players who have problems.

12-18-2009, 12:20 AM
Yes you are right that will cause lots of probs. I will need to to work on that shouldnt be to difficult. I need to do this cookie stuff first.

I need to add a cookie script to my Paypal button html. The cookie needs to expire so no refresh or go back option is available and so will validate the cookie in the .htaccess file? and give the user limited access to game page. Help with this script will be much appreciated. Thanks