Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
que: convert ads to point downloads
Old 09-05-2007, 11:22 PM que: convert ads to point downloads
Novice Talker

Posts: 7
Name: eka kurniawan
Trades: 0
sory for fool question, i'm newbie in web coding

i want make web content that my user get point to download by click ads,
for sample if my user click 3 ads, will get 3 time downloading something in my web. anyone know script like that?

thank

get $25 for new developers
ekapwt is offline
Reply With Quote
View Public Profile Visit ekapwt's homepage!
 
 
Register now for full access!
Old 09-06-2007, 05:53 AM Re: que: convert ads to point downloads
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
I'm not sure if I'm understanding the situation, do your users have ads that other people click on or do your users themselves click on the ads? In either case the way I would approach the problem would be to create ads that link to a php script and pass an id belonging to the owner of the ad via url. For example your ad might look something like this:

<a href="http://yoursite.com/redirect.php?id=11111">Your Ad Here</a>

id would be a unique id corresponding to the owner of the ad. Now on the backend you will want to find the user corresponding to that id in a MySQL database and increment a counter representing the number of clicks. Then you will forward the user who clicked the ad to their intended destination using the header command. A simple mock up will look something like this:

PHP Code:
<?php
$id 
$_GET['id'];

$sql 'SELECT * FROM `users` WHERE `id` = \''.$id.'\' LIMIT 1;';
$result mysql_query($sql);

if(
$row mysql_fetch_array($resultMYSQL_ASSOC))
{
     
$count $row['count'];
}
else
{
     
//failed to interface with database so just forward the user to their
    //location
     
header('Location: http://destination.com/');
}

$count++;
$sql 'UPDATE `user` SET `count` = \''.$count.'\' WHERE `id` = \''$id'\';';
mysql_query($sql);

header('Location: http://destination.com');

?>
I left out some details such as the database information. You should also store the ip addresses of the users who have clicked the ads so someone won't take advantage of the system by repeatedly clicking the ad.

Now when it comes time for the user to download something on your site just check how many points they have and decrease it by one once they download. Feel free to contact me if you have questions. Also if you want someone to code this up for you I'm willing (provided that the job pays my rent and tuition don't pay themselves).
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Last edited by NullPointer; 09-06-2007 at 05:57 AM..
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 09-08-2007, 03:59 AM Re: que: convert ads to point downloads
Novice Talker

Posts: 7
Name: eka kurniawan
Trades: 0
big thx for reply brother, i ll try first.
i want my users to click on my ads and then i give point as much as my user click on.
as i looking for ads script all of them mean ads >> money = affiliate. but if you mean log will be stored on sql, i'ts will be easy ( i hope )for me to mod/edit the similar script.

thx
ekapwt is offline
Reply With Quote
View Public Profile Visit ekapwt's homepage!
 
Old 09-08-2007, 08:55 AM Re: que: convert ads to point downloads
Skilled Talker

Posts: 62
Name: Tom Wright
Location: Brighton, UK
Trades: 0
Just a quick warning ekapwt, requiring users to click ads is against the user-agreement with many ad programs. The Google Adsense TOC has a clause which says:
Quote:
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, or Referral Button through any automated, deceptive, fraudulent or other invalid means, including but not limited to through repeated manual clicks, the use of robots or other automated query tools and/or computer generated search requests, and/or the unauthorized use of other search engine optimization services and/or software;...
(Emphasis mine)
So be very careful when implementing this.
All the best,
Tom
__________________
My site:
Please login or register to view this content. Registration is FREE
tomythius is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to que: convert ads to point downloads
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.19159 seconds with 12 queries