#!/usr/bin/perl ########################################################################## ## ## ## IntelliLink Pro v4.0 ## ## ---------------------- ## ## by Jimmy (wordx@hotmail.com) ## ## http://www.smartCGIs.com ## ## ## ## IntelliLink Pro is not a free script. If you got this from someone ## ## please contact me. Visit our site for up to date versions. Most ## ## CGIs are over $100, sometimes more than $500, this script is much ## ## less. We can keep this script cheap, as well as a free version on ## ## our site, if people don't steal it. If you are going to use a ## ## stolen version, please atleast DO NOT remove any of the copyrights ## ## or links to our site, they keep this CGI cheap for everyone. ## ## Thanks! ## ## ## ## (c) copyright 2000 SmartCGIs.com ## ########################################################################## require "variables.cgi"; $buffer = $ENV{'QUERY_STRING'}; @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name,$value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s/~!/ ~!/g; $in{$name} = $value; } $id = $in{'id'}; $gid = $in{'gid'}; if($id eq "") { &gotosite; exit; } &getdate; if(($anticheat eq "0")||($anticheat eq "1")) { # cheating is bad, let's do what we can to prevent it... if($gid ne "$dayofmonth$dayofyear$weekday$hour") { if($reflog eq 1) { &logref; } if($banref[0] ne "") { &banref; } if($anticheat eq "0") { print "Content-type: text/html\n\n"; print < $body You are being redirected to... $sitename


Continue to $sitename EOF exit; } else { print "Content-type: text/html\n\n"; open(DATA,"html/gateway.html"); @html = ; close(DATA); $html = join('',@html); $url = "$cgiurl/in.cgi?id=$id&gid=$dayofmonth$dayofyear$weekday$hour"; $html =~ s/\[url\]/$url/g; print "$html\n"; &info; exit; } exit; } } else { # done anti cheat measures. if($reflog eq 1) { &logref; } if($banref[0] ne "") { &banref; } } unless($resetdays eq 0) { open(DATA,"reset.txt"); $reset = ; close(DATA); } unless($updatetime eq 0) { open(DATA,"update.txt"); $update = ; close(DATA); } $timenow = time(); unless($resetdays eq 0) { if($timenow > $reset+($resetdays*86400)) { &reset; } } &iplog; &counthit; unless($updatetime eq 0) { if($timenow > $update+($updatetime*60)) { &update; } } if($cookielink eq 1) { print "Set-Cookie: id=$id; path=/; expires=Mon, 01-Jan-2005 00:00:00 GMT\n"; } &gotosite; sub gotosite { if($siteurl[1] eq "") { print "Location: $siteurl[0]\n\n"; } else { $randnum = int rand(@siteurl); print "Location: $siteurl[$randnum]\n\n"; } } sub counthit { open(DATA,"members/$id.data"); flock (DATA,2); $countdata = ; flock (DATA,8); close(DATA); @countdata = split(/ /, $countdata); $countdata[0]++; open(DATA,">members/$id.data"); flock (DATA,2); print DATA "$countdata[0] $countdata[1]"; flock (DATA,8); close(DATA); } sub iplog { open(LOG,"iplog.txt"); @log = ; close(LOG); $logip = "$ENV{'REMOTE_ADDR'}"; if(($count_noip eq 0)&&($logip eq "")) { &gotosite; exit; } foreach $log (@log) { chomp($log); ($address, $idnum) = split(/\|/, $log); if(($id eq $idnum)&&($logip eq $address)) { &gotosite; exit; } } if (-e "iplog.txt") { open (PFILE, ">>iplog.txt"); print PFILE "$logip|$id\n"; close PFILE; } else { open (PFILE, ">iplog.txt"); print PFILE "$logip|$id\n"; close PFILE; } } sub logref { $referrer = $ENV{'HTTP_REFERER'}; open(DATA,">>members/$id.ref"); print DATA "$referrer\n"; close(DATA); } sub banref { $referrer = $ENV{'HTTP_REFERER'}; if($referrer ne "") { foreach $banref(@banref) { if($referrer =~ /$banref/i) { &gotosite; exit; } } } }