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.

 

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
New Webmasters ask "How-To" questions here. This is where other fucking Webmasters help.

 
Thread Tools
Old 03-04-2011, 07:24 PM   #1
DirtyRider
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 Thanks.
__________________
hello
DirtyRider is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 03-13-2011, 04:25 PM   #2
Sexgenoten
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!

Last edited by Sexgenoten; 03-13-2011 at 04:26 PM.. Reason: grammar
Sexgenoten is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 03-14-2011, 07:03 AM   #3
daniel_webcams
Confirmed User
 
daniel_webcams's Avatar
 
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.
__________________
Daniel,

Skype: [email protected]
ICQ: 354-220-339
Email: daniel@adultforce[dot]com


daniel_webcams is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 03-14-2011, 07:33 AM   #4
Dappz
Confirmed User
 
Dappz's Avatar
 
Join Date: Dec 2009
Posts: 997
not sure about this
__________________


Hentai Artist * Draw My Anime *
HentaiLovers * hentaiG4H * ICQ : 657458
Dappz is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 03-14-2011, 10:50 AM   #5
robber
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
robber is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 03-16-2011, 12:25 AM   #6
Sexgenoten
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);			
	});
	
}
On the api.php:

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

}
Sexgenoten is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 03-25-2011, 12:19 PM   #7
robber
Web Developer
 
Industry Role:
Join Date: Jan 2011
Location: UK
Posts: 264
You need to watch the script as:

Quote:
On the api.php:

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

}
could be easily spammed by being posted to by a cURL process :D, you need some sort of check for the requester to make sure it is your server

Otherwise, nice bit of code

Rob
robber is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
Old 03-26-2011, 04:12 PM   #8
Sexgenoten
Registered User
 
Industry Role:
Join Date: Dec 2010
Posts: 85
Quote:
Originally Posted by robber View Post
could be easily spammed by being posted to by a cURL process :D, you need some sort of check for the requester to make sure it is your server
Very true. As i havent implement security yet, i have no example code but i can tell what im going to do.

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 ;)
Sexgenoten is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook
 
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.