homepage Welcome to WebmasterWorld Guest from 54.211.34.105
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
PHP for outbound links?
Marcia

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



 
Msg#: 460 posted 7:31 am on Jun 13, 2002 (gmt 0)

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?

 

Nick_W

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



 
Msg#: 460 posted 1:06 pm on Jun 13, 2002 (gmt 0)

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

Marcia

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



 
Msg#: 460 posted 4:44 am on Jun 14, 2002 (gmt 0)

>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.

Lisa

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 460 posted 6:54 am on Jun 14, 2002 (gmt 0)

<?
// 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.

Nick_W

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



 
Msg#: 460 posted 6:58 am on Jun 14, 2002 (gmt 0)

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved