Find programmers and grapic design experts at ScriptLance.com
<? DEW-CODE.COM  
Dew-Code
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Hits Out not working (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Hits Out not working
#78
canoe (User)
Fresh Boarder
Posts: 12
graphgraph
User Offline Click here to see the profile of this user
Hits Out not working 6 Months, 3 Weeks ago Karma: 2  
My "Hits Out" counter has stopped working. New sites always show "Hits Out: 0" no matter how many times I click on them. (And this is not a browser refresh issue.)

I see in the FAQ section that some problems can be caused by unavailability of global variables so I tried adding the suggested 5 lines of code near the top of my "directory" file. This made no difference. Other ideas?
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#79
Dewed (User)
Administrator
Posts: 220
graph
User Offline Click here to see the profile of this user
Dew-Code.com
Re:Hits Out not working 6 Months, 3 Weeks ago Karma: 7  
Thats odd..

To clarify, many people think Hits Out is broken because repeated clicks aren't counted.. It's actually programmed to only count the initial click from any IP address. Subsequent clicks from the same IP are ignored..

but you are saying it's actually broken.. "Hits Out: 0" um.. that makes no sense.
You are apparently being directed to the correct website, so out.php obviously knows the site ID, it uses the site ID to fetch the url from the database. It also checks your IP against the last IP that clicked that site ID, and if it's not a match it's *supposed* to increment the count..

After 3 include lines, my out.php looks like this ...
NOTE: I've compacted it a bit
Code:

$ID=$_GET['ID']; if(isset($ID)){ $get_site = sql_query("select SiteURL, OutIP from $tb_links where ID='$ID'"); $get_row = sql_fetch_array($get_site); $url = $get_row[SiteURL]; } if($REMOTE_ADDR != $get_row[OutIP]){ $result = sql_query("update $tb_links set HitsOut = HitsOut + 1, OutIP = '$REMOTE_ADDR', LastUpdate = LastUpdate where ID = '$ID'"); } header("Location: $url");
BINGO !.. I think.. the $REMOTE_ADDR variable is likely empty. Try adding this, just after the "include" lines
Code:

$REMOTE_ADDR=$_SERVER["REMOTE_ADDR"];
PS, the additions you made to the directory file don't really come into play here, since it's out.php that does the count increment, but those additions certainly won't hurt, and after your web server's apparent upgrade/security lock down you likely solved a problem you hadn't discovered yet.
 
Report to moderator   Logged Logged  
 
Last Edit: 2008/04/28 07:14 By Dewed.
 
Nothing to it but to Dew it !
Dew-Code.com
  The administrator has disabled public write access.
#80
canoe (User)
Fresh Boarder
Posts: 12
graphgraph
User Offline Click here to see the profile of this user
Re:Hits Out not working 6 Months, 3 Weeks ago Karma: 2  
Awesome! That did it. Thanks.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop

Newsflash

Sign up for PayPal and start accepting credit card payments instantly.
Copyright Dew-Code 2008