Jump to content

Click Ads and then Download


areeb

Recommended Posts

Hello all ..I am looking for creating a Download Area.My Aim to create such a page e.g. if a user wants to download a file as abc.mpg than first a Adverstisement should appear on the page, and the user must Click on the Advertisement and after Clicking he will be given with the actual File.If he does not click on Advertisement than he should not be given the file ..IT will be definitely possible in PHP.So how can we do this ?Thanks

Link to comment
Share on other sites

most sensible people wont click on adverts, no matter how much they trust the site.people dont trust the adverts, as they sometimes do hidden things, take you to background pages that eat up your phone bill, or go to some xxx-rated site, or download viruses and such.i dont recommend getting your visitors to click on ad's before downloading a file.

Link to comment
Share on other sites

Ok I agree, but the point is that I will only use trusted Ad Services such as one by Google Adsense etc.If u visitor doesnot want to click on Ads than its upto him. :)Can someone please tell me a possible code for this ?

Link to comment
Share on other sites

Ok, Sir, I admit that I will limit my Downloads, but please I want such type of scripts :)I just dont want a FREE Download area because obviously one makes a website for earning. One way is to make a premium area where only paid members will come. But I want my site to be free, and yet I want to earn revenue. I hope u have understood what I mean.So I am responsible for limiting of Downloads etc, but can I have any help on any such script :)Thanks

Link to comment
Share on other sites

I am not gonna write a code that involves adds, period. I hate adds.But I do can help you here, if you would just loose the idea of using adds for payment. You can still make a members area to let people download paid things, and leaving the free area without any downloads, or at least without the ones you want them to pay for. :)If you like that idea, then its fairly simple. Either using the paypal system, which some people might not like to use, or supplying a form with which the members can fill in their home address so you can send a bill or something. There is a disadvantage, people don't always like to fill in such information, nor to pay via paypal (but paypal is winning territory). But then again, they don't like adds either.

Edited by Dan The Prof
Link to comment
Share on other sites

OK ... so how to go for a member area ?I mean to create an area, where only members can download. While Guest can only view files. Member's data will be stored in MySQL, and I know how to do that ...I only need help on, where only members can download. While Guest can only view files.Thanks ....

Link to comment
Share on other sites

You could use sessions to store the data they filled in on loggin in their account at your site :)Then validate their account against being either guest or member, and let PHP print, output or redirect to the according place :)Example:

if ($_SESSION['function'] == "guest"){ echo "Welcome guest, you may view files here, or login to download them."; }elseif ($_SESSION['function'] == "member"){ echo "welcome to the members area, you may download the files here."; }else{ echo "Welcome administrator, what do you want to do?"; }
:)[*Edit:] You should visit the php tutorial for Sessions, and see what you can do :blink: Edited by Dan The Prof
Link to comment
Share on other sites

Regardless of what an individual person thinks, ads are a very viable way to make income with a website and the vast majority of websites that do not charge for the services they offer make their money off ads, including w3schools. Ads are a part of the internet, that is that. It's up to the site designer to implement them so that they are not invasive, and if they are, users will not use the site. If users don't trust the ad, they don't have to click on it, and they don't have to use the site. Or you can just use Opera, and not get affected by anything bad that might happen. End of story.You can probably do something with javascript, but a user can always fake it. But only a very dedicated user would go through the headaches to fake it instead of just clicking the ad then closing the next page. So, you could probably use some javascript to do a request using the XMLHTTPRequest object (http://www.w3schools.com/xml/xml_http.asp). You would put the code that uses this on the onclick event for the ad link. When they click the ad, you send a request using that object and update a temporary database or something on the server saying that this IP address clicked on an ad for file X. And then when they click on the link for the file, you lookup in the database if they clicked on the ad, and send the file if they did. You could also delete the entry out of the database at that time to keep it clean. So you would have a link that says 'download' link to a page that looks something like this:

...click here to visit our sponsorclick here to download the file after you clicked on the above link...

They would click the first one (which sends the request and updates the database), and then the second one (which checks if they clicked the first and sends the file if they did). That's probably the easiest way to go for something like this.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...