Hello,

I am looking for a free ads management script. Basically, every time someone click on the ads, in the website backend there is a daily and monthly graphic and table statistic that record the ads click.

Any idea?

Recommended Answers

All 9 Replies

Well, I can't find the script that works on localhost.

Well, is it difficult if I design it on my own. I would like a script that's able to count how many visitors clicks daily weekly and monthly then summarize them on graph.

Member Avatar for LastMitch

@davy_yg

Well, I can't find the script that works on localhost.

I'm bit confused? Why you want it to work on localhost? How can you count visitors or test the ads if you are on Xampp or EasyPHP?

Well, is it difficult if I design it on my own. I would like a script that's able to count how many visitors clicks daily weekly and monthly then summarize them on graph.

My advice just buy a script.

@davy_yg

Why are you saying it is difficult to design it on your own? Have you tried it yet? Did you attempt to at least jot down how would your program will flow?

A part of being a coder is to be able to write codes when there is no ready made open source out there. What you want to write is not even that hard... I mean a cup of hot nicely brewed coffee (starbucks), can definitely help out to visualize how the program should react to your user's click..

Please allow me to help you build the basic core foundation of the program you are trying to achieve or make.

First, you will need a page to add the banner links of the sponsors. Make sure the destination domains of these sponsors are saved in your database.

Second, the outgoing link should be forwarded to your outgoing page to track which url or domain is being clicked. This event should executed in split second, and the browser should not be held more than a blink of an eye. In this outgoing page, you will need to update your database by adding 1 to the outbound count as the browser is being redirected to the sponsors domain.

Third, create a function of which it will be able to detect the referring url, you then match this url to your sponsors or link exchange partners to track down how many are bouncing, returning, and coming from external links to your site.

Now, let us take a look at the suggested program design flow above, is it feasible or doable in PHP? Of course it is. I think that's pretty darn easy to achieve.

Ok, while typing this.. idea just shocked me, that I almost fell on the floor. Here is your link page should look like. Assuming that we already have a database table named 'sponsors' and the appropriate columns as needed.

    ## your link page or banner page should look like this. Remember you can always show one banner or one link at a time depending on your plans of implementation.

    ## we can start by preparing our database query.. it can be simple as this

    $query = "SELECT url, ads_name, ads_url FROM sponsors"; 

$get_These_Ads = mysql_query($query) or die(mysql_error());


while($row = mysql_fetch_array($get_These_Ads)){

    echo '<a href="outgoing.php?url='. $row['ads_url .'&ads_name='. $row['ads_name'] .'">'. $row['url'] .'</a>';

}

As you can see, the codes above shows links from the database being forwarded to the outgoing.php..

So, our imaginary outgoing.php should be something like this..

    ## lets create a simple function to capture the url 

    function Get_This_Url($thisUrl){

    if(!$thisUrl){

    ## sorry false alert no forwarding url
    ## for now I will use the useless exit function. It is all up to you what you want to put here.

    exit;

    }

    mysql_connect($db_host, $db_user, $db_password) or die("Install Script First") ;

mysql_select_db('sponsors') or die("Db Not Found") ;

$sql = "UPDATE sponsors SET `ads_traffic` = `ads_traffic` + 1 WHERE Url='$thisUrl'" ;

mysql_query($sql) or die("Error Adding Stats") ;

}

Again, I am in the assumption here about the table called sponsors.. the function above can be called just like this ... :)

if(isset($_GET['url')){

## redirect the browser immediately.. the php function below already updated the database for the click.

Get_This_Url($_GET['url']) ;
echo '<meta HTTP-EQUIV="REFRESH" content="0; url=http://'. $_GET['url'] .'">' ;

 }

 else{

 ## once again it is all up to your where to redirect the browser or better yet show them some wonderful banners here to click

 }

Let me type a little bit more, because I am being decaffeinated and I am losing my focus.. :)

The database table can be something like this

    table name: sponsors
    +-----+------+----------+---------+-------------+
    + id  +  url + ads_name + ads_url + ads_traffic +
    +-----+------+----------+---------+-------------+

For every click that comes through the outgoing.php the ads_traffic value will be incremented by 1.

That's it for now, I already have given you pretty much the core part of the program( the part that we can consider as the difficult one).. By few more minutes of tinkering, you should be able to expand the simple script above.

Well, how to create the script that everytime someone click on the ads the tracking start counting ?

Member Avatar for LastMitch

@davy_yg

Well, how to create the script that everytime someone click on the ads the tracking start counting ?

veedeoo mention this:

"For every click that comes through the outgoing.php the ads_traffic value will be incremented by 1."

I mean what's the exact code for " if (ads_click)" ?

Hello someone draft me this script. Can anyone help me write the realscript?

// abcd.com/numberofklik.php?idads=[idadsnya]

// url nya: abcd.com/numberofklik.php?idads=[idadsnya]

$con = mysql_connect("localhost","root","");

mysql_select_db("my_db", $con);

if ($_GET['idads']==1){}
{
count++;

mysql_query("insert into jumlahklik (idads,waktu) values ('idadsnya','2012-11-18 08:19:30')");
}

header("location:real url address");exit();

Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\Innovation\script_shop\adsmgt.php on line 19

line 19:int count = 0;

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.