Require Click on Ad

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
waradmin
Forum Contributor
Posts: 240
Joined: Fri Nov 04, 2005 2:57 pm

Require Click on Ad

Post by waradmin »

I am looking for a way to require a user to click on an Ad (either on the page directly or in an iFrame) before displaying the next page. Is there a way in PHP (or even JavaScript) that will detect that a user clicked on a link before redirecting them to the next page?

I am working on a download script and want to require the user to click on a google adsense ad for example.

Thank you. I have searched but found nothing useful.
User avatar
nickman013
Forum Regular
Posts: 764
Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York

Post by nickman013 »

So basically before they go to another page on your site, you want the page to view a ad first, then redirect to the next page?

If thats the case I would do it like this.

Make a ads.php page that has the content you want them to view before going to the next page.

And then on all of the links on your site write then going to ads.php, but...

for example.

Code: Select all

//this is going to go to home.
<a href=ads.php?redirect=home>click here to go home</a>
Then on the ads.php page have some sort of redirection that redirects the user in how many seconds or what ever.

On ads.php use $_GET to get the page to redirect to.


Sounds confusing but really easy.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

This is probably the way i'd go to solve the problem...

Code: Select all

<?php 
if (!isset($_SESSION)) {
  session_start();
}

if (!isset($_SESSION['ads'][md5($_SERVER['REQUEST_URI'])])) {
  // display advertisement 

  echo '<a href="?action=seenad">move to actual content..</a>'
  exit;
}

if (isset($_GET['action'] = 'seenad')) {
  $_SESSION['ads'][md5($_SERVER['REQUEST_URI'])] = 'seenad';
}

// display actual page
?>
User avatar
waradmin
Forum Contributor
Posts: 240
Joined: Fri Nov 04, 2005 2:57 pm

Post by waradmin »

Im looking for something like this:

http://dlurl.net/?7lVvh

I looked at the code above and before messing with it i thought i would post a link of a demo.
sierradwyer
Forum Newbie
Posts: 3
Joined: Sat Mar 25, 2006 2:32 am

Post by sierradwyer »

I am glad I came across this site. I am hoping that maybe somebody can help me with this same situation.

I am running an image host site and it's 100% free. People are able to create accounts and manage there images and so on.

The problem is... I am paying for hosting of this site, and I am not getting anything in return. Don't shout at me for wanting a small price just to cover my hosting costs at least.

If I am able to force the people that host images on my site to click on the google ads before it displays there picture with links, then I figure and I can actually get something in return.

Here is my site - Game-Image.com :twisted:
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

that will get you banned from google adsense quickly ;)
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

but erm i suppose if you want to get banned you could password protect the page, make them click on an ad and the password would be the x word in paragraph x.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
sierradwyer
Forum Newbie
Posts: 3
Joined: Sat Mar 25, 2006 2:32 am

Post by sierradwyer »

I'm not entirely sure what you are saying because I am not good with php or javascript.

My question now is..... can this be done?
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

sierradwyer wrote: Here is my site - something.invalid
Congratz, you actually got me to go read the adsense policy... Still wondering if i should report that site.
sierradwyer
Forum Newbie
Posts: 3
Joined: Sat Mar 25, 2006 2:32 am

Post by sierradwyer »

lol, you can see my site is doing well :lol: HA HA :lol:

there is nothing to report :twisted: :twisted: :twisted: :twisted: :twisted: :twisted:
User avatar
Moocat
Forum Contributor
Posts: 143
Joined: Wed Oct 12, 2005 9:28 am
Location: USA

Post by Moocat »

sierradwyer wrote:lol, you can see my site is doing well :lol: HA HA :lol:

there is nothing to report :twisted: :twisted: :twisted: :twisted: :twisted: :twisted:
You also might want to make the rules more prominent. Reporting people's IP addresses for misusing your website is a waste of your time as well. I would suggest you put a rules link or short description of what is allowed to be uploaded on the upload page. Grey on grey text is also not the best color scheme, I might suggest making your text darker.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

sierradwyer wrote:lol, you can see my site is doing well :lol: HA HA :lol:

there is nothing to report :twisted: :twisted: :twisted: :twisted: :twisted: :twisted:

uhh, have you read their terms of service?
Prohibited Uses. You shall not, and shall not authorize or encourage any third party to: (i) directly or indirectly generate queries, Referral Events, or impressions of or clicks on any Ad, Link, Search Result,
Back to the topic at hand please..
Post Reply