Jump to content

Restricting content based on number of views


benyates1

Recommended Posts

Hi,

 

I have a web site that sells both video and images. The full versions are located securely behind a paywall, however in a bid to get visitors to purchase them and to promote the members offering I have trailer videos of 30 seconds to one minute and four free images per imageset.

 

I want to be able to restrict the number of images a visitor can view for free to 12 and the number of videos a visitor can play to 5. With a little graphic/overlay notifying the user when they have exceeded their free play/preview limit.

 

I have been advised that a tracking cookie and php if statement would be the way to go to achieve this.

 

I have got a cookie that is successfully logging views that is written to on a free preview link as an onclick function.

 

I have tried writing some php if code that will have the normal thumbnail or video divs display as usual if the views recorded in the cookie are below 12 or five, respectively, and have a not allowed, please subscribe div that would show over the thumbnails or video divs should the number of views exceed the threshold.

 

My PHP code does not seem to be working at all, I have ran it through an online syntax checker - corrected the mistakes and now it's supposed to be working but opts to display nothing instead of either if argument.

 

Videos then become a whole other problem because at the moment I have no other way to track the view/visit other than to count the loading of the video summary page with the free player as the preview, whether or not the clip is played - ideally I would like the view to be counted when the video begins to play. But I have no idea how to write to the cookie from Flash (is that even possible?)

 

Any help would be greatly appreciated.

Link to comment
Share on other sites

Don't rely on cookies to protect your files. Users could easily delete them or browse in an incognito type of mode to get around your security. Instead you should force all video/image requests through a separate script. In that you can perform all your user verification and tracking, and then send the response back as the requested content.

Link to comment
Share on other sites

more of an irritant than anything else
Much like with modern DRM, you're going to do nothing but annoy your paying customers and the pirates will gleefully bypass your irritant.  Either do security properly or don't do it at all.  "I want my site to be annoying to use" is never a good business model.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.