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.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 10-25-2010, 03:14 AM   #1
Emil
Confirmed User
 
Emil's Avatar
 
Join Date: Feb 2007
Location: Sweden
Posts: 5,648
Simple way to catch referer using javascript and PHP?

Lets say I want people to put a small javascript on their site. This javascript should "send" the referer-URL to one of my PHP-scripts on my server.

How could this be done? All these webcounters use Javascript, can anyone plz explain how I can do this?
__________________
Free 🅑🅘🅣🅒🅞🅘🅝🅢 Every Hour (Yes, really. Free ₿itCoins.)
(Signup with ONLY your Email and Password. You can also refer people and get even more.)
Emil is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-25-2010, 03:39 AM   #2
redwhiteandblue
Bollocks
 
redwhiteandblue's Avatar
 
Industry Role:
Join Date: Jun 2007
Location: Bollocks
Posts: 2,793
You could do something simple like

Code:
<script language="Javascript" type="text/javascript">
<!--
var docRef = document.referrer
docRef = encodeURIComponent(docRef) //URI encode the referrer string
dummyPhpImg = new Image
dummyPhpImg.src = '/yourserversidescript.php?REF=' + docRef
//-->
</script>
Basically loads a dummy image object which is actually your php script, don't forget to send a header response as an img file at the of the script, it can be an empty 1x1 pixel image, doesn't matter as you're not going to display it. BTW you can add more parameters to the query string such as screen size, client time, etc.
redwhiteandblue is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-25-2010, 03:45 AM   #3
Emil
Confirmed User
 
Emil's Avatar
 
Join Date: Feb 2007
Location: Sweden
Posts: 5,648
Thank you!
__________________
Free 🅑🅘🅣🅒🅞🅘🅝🅢 Every Hour (Yes, really. Free ₿itCoins.)
(Signup with ONLY your Email and Password. You can also refer people and get even more.)
Emil is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
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.