![]() |
PHP: Tracking incoming and outgoing its
I've seen $_SERVER['HTTP_REFERER'] used to track incoming hits. Is their anything more reliable then this?
Also, I was wondering if theirs a way to track outgoing hits some how? I don't want to use anything like out.php?s=domain.com. Maybe some Javascript onclick? Not sure how traffic trading scripts are really doing it. Any help would be greatly appreciated :) Thanks. |
I have no experience with trade scripts but if i would want to check on outgoing links i'd would do something like the following:
I'd have a href as a link with an id and a onmousedown function. When the href is clicked, the onmousedown function would be triggered. In this javascript function i'd retrieve the link and would use jquerys $.post to sent the information to an api page. On the api page you would retrieve the information from the $_POST array and subsequently insert it into a database. Make sure your api page only accepts incoming arrays from ur own domain. GL! |
you could use this java script : http://forum.lrytas.lt/topic_show.pl?tid=83254 works together with a small php code, not sure if the code work, but here's another another one as back up http://www.experts-exchange.com/Prog..._21661004.html
I think this is exactly what you need. |
not sure about this :)
|
incoming would work as a refferer, but you could log them as incomings, but also record your ip for the current day and have a limitation as to how often someone will be logged on the system in the timeframe this would stop the same person repeatedly clicking a link, or produce a link code which ties into your system, thus meaning the trader would get nothing off a straight link they need to go through the link code
Rob |
Well, i figured i too needed to track my outgoing traffic, so here is a fast and simpel javascript/jquery solution that works for me:
Code:
function outboudTraffic( obj ){// make sure that the $_POST is coming from your domain and that you are not being // spammed. if ( isset( $_POST['clicked_link'] ) && !empty( $_POST['clicked_link'] ) ){ // insert it into a database // } |
You need to watch the script as:
Quote:
Otherwise, nice bit of code Rob |
Quote:
I think there are 2 options ( i might implement both ): 1. Check de $_SERVER array on the api page. I'm not sure if the desired information will be there as its a jquery post, but i think it will be. 2. Have hidden input array with session_id, logged_in_status encrypted with a set key and use base64_encode on it ( server side ). This much i already have ;) Make an active table in the db and have javascript send a $.post every 15 min to the api to update the active table. Then, when a request comes in to insert a new link, you can check if the last active entry in the table of the session, is within 15 min. If so, insert the link, if not, no action. ( perhaps log it, so you can see whose trying to screw u over or to check if your code isnt screwed up ;) ) I'll prolly end up implementing both ;) |
| All times are GMT -7. The time now is 03:29 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123