|
|
|
||||
|
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
|
|||||||
| New Webmasters ask "How-To" questions here. This is where other fucking Webmasters help. |
|
|
Thread Tools |
|
|
#1 |
|
Confirmed User
Join Date: Feb 2003
Posts: 819
|
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
__________________
hello |
|
|
|
|
|
#2 |
|
Registered User
Industry Role:
Join Date: Dec 2010
Posts: 85
|
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! |
|
|
|
|
|
#3 |
|
Confirmed User
Industry Role:
Join Date: Nov 2008
Posts: 2,491
|
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.
__________________
|
|
|
|
|
|
#4 |
|
Confirmed User
Join Date: Dec 2009
Posts: 997
|
not sure about this
__________________
|
|
|
|
|
|
#5 |
|
Web Developer
Industry Role:
Join Date: Jan 2011
Location: UK
Posts: 264
|
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 |
|
|
|
|
|
#6 |
|
Registered User
Industry Role:
Join Date: Dec 2010
Posts: 85
|
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 ){
// obj comes from a ahref
// get the src of the ahref object
var link = $( "#" + obj.id ).attr( "href");
// post the link value as an clicked_link post variable ( $_POST['clicked_link'] )
$.post("api.php", {
clicked_link : link
}, function(data){
//i use this to alert debugging information
//i turn it off when going live
alert( data);
});
}
// 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 // } |
|
|
|
|
|
#7 | |
|
Web Developer
Industry Role:
Join Date: Jan 2011
Location: UK
Posts: 264
|
You need to watch the script as:
Quote:
Otherwise, nice bit of code Rob |
|
|
|
|
|
|
#8 | |
|
Registered User
Industry Role:
Join Date: Dec 2010
Posts: 85
|
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 ;) |
|
|
|
|