Welcome to WebmasterWorld Guest from 54.166.227.36

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

PHP for outbound links?

     
7:31 am on Jun 13, 2002 (gmt 0)

WebmasterWorld Senior Member marcia is a WebmasterWorld Top Contributor of All Time 10+ Year Member



There are a few banners going on a homepage for an exchange. There's no sense in them being picked up, it'll be a distortion since it's just temporary.

Is there a PHP snippet to run the links through, either with or without a click-through count to see what's being sent off?

1:06 pm on Jun 13, 2002 (gmt 0)

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member



If I uderstand you right (and I'm not sure), no there isn't. PHP is serverside and limited to the server it's on so any outgoing links can't be done much with.

Unless you want to get a little complex (just thought of this ;-) what you might do is have the banner link go to a script on your site that does some stuff (like increment click throughs etc) then redirects the UA to the banners home page...

Certainly nothing simple though Marcia..

Nick

4:44 am on Jun 14, 2002 (gmt 0)

WebmasterWorld Senior Member marcia is a WebmasterWorld Top Contributor of All Time 10+ Year Member



>have the banner link go to a script on your site that does some stuff (like increment click throughs etc) then redirects the UA to the banners home page...

That is exactly what I want it to do! I can't see messing with PR for something very temporary, and counting clicks would make it evident whether it's wise to do that type of thing on a continuing basis. Besides, the reciprocal arrangements are made first and I check the sites after; it would be easier to avoid that.

I thought of PHP because it's cross-platform and a bit easier, but Perl will do if that type of script is easier to find. Even a banner rotation script would work, since it'll be needed on other sites eventually.

6:54 am on Jun 14, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<?
// I snipped the mysql connection routine and some other code.

$query = "insert into stats.click (ip,datetime,<snip>,referer) values ('$ip','$datetime',<snip>,'$referer')";
$result = mysql_query ($query) or die ("<!-- $query -->");
header("Location: [webmasterworld.com...] ");
exit;
?>

Here you go. Really simple script. You can monitor every click or you can select the previous count and increment it.

6:58 am on Jun 14, 2002 (gmt 0)

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Yep, you'd have something like this:

// banner script
select all from banner_table where id = the id passed in url (the banner id)
increment the count
direct to the banner home page (also contained in the banner_table)

Nick

 

Featured Threads

Hot Threads This Week

Hot Threads This Month