/    Sign up×
Community /Pin to ProfileBookmark

logging referrers?

this is basically what i need:

-logs browser’s previous page coming to current page
-logs ips possibly?
-logs time and date?
-stores all information in a .html or .txt file or something viewable through a browser
-coding that will work in .js format

can anyone help me please?

to post a comment
JavaScript

9 Comments(s)

Copy linkTweet thisAlerts:
@phpnoviceMay 31.2006 — Cannot be done with JavaScript. Seek a server-side language, e.g., ASP or PHP.
Copy linkTweet thisAlerts:
@damnhaoauthorMay 31.2006 — Cannot be done with JavaScript. Seek a server-side language, e.g., ASP or PHP.[/QUOTE]


http://www.javascript-page.com/referrer.html something like this but logs to a text type file cant be done?
Copy linkTweet thisAlerts:
@A1ien51May 31.2006 — JavaScript has no IO ability. AKA: it can not write to a file. You need a server side language to do it as already pointed out.

Eric
Copy linkTweet thisAlerts:
@felgallMay 31.2006 — You also can't rely on referrers as that field is under your visitor's control. If they don't want you to know where they came from then this field will be blank or contain a dummy value (depending on which browser or firewall they used to disable it).
Copy linkTweet thisAlerts:
@phpnoviceMay 31.2006 — You also can't rely on referrers as that field is under your visitor's control.[/QUOTE]
I've seen nothing that would support that statement. Instead, everything I've seen, and experienced for myself, says that the HTTP REFERRER header is under the control of each web server. However, the end result is the same -- the HTTP REFERRER header may or may not be present.
Copy linkTweet thisAlerts:
@UltimaterMay 31.2006 — 
You also can't rely on referrers as that field is under your visitor's control.[/QUOTE]
I've seen nothing that would support that statement. Instead, everything I've seen, and experienced for myself, says that the HTTP REFERRER header is under the control of each web server. However, the end result is the same -- the HTTP REFERRER header may or may not be present.[/QUOTE]

The referer can easily be spoofed. Take this test page I setup for example:

<i>
</i>&lt;?php
$r=$_SERVER['HTTP_REFERER'];
if($r != "https://www.ultimater.com/admincp.php"){
?&gt;
Only members from our trusted site &lt;a href="https://www.ultimater.com/admincp.php"&gt;https://www.ultimater.com/admincp.php&lt;/a&gt; can view this page's content.&lt;br&gt;
&lt;?
}else{
?&gt;
Congratulations! you have successfully spoofed the referer!
&lt;?
}
?&gt;

First enter it directly:

http://aplustv.com/public_stuff/httpreferer.php

Now try spoofing it with PHP:

http://aplustv.com/public_stuff/spoofer.php?url=http%3A%2F%2Faplustv.com%2Fpublic_stuff%2Fhttpreferer.php&referer=+https%3A%2F%2Fwww.ultimater.com%2Fadmincp.php
Copy linkTweet thisAlerts:
@phpnoviceMay 31.2006 — The referer can easily be spoofed.[/QUOTE]
Yeah, I've seen your spoof. But it doesn't address the issue posed. Then again, perhaps you just wanted to make the OP aware of it, too. :p
Copy linkTweet thisAlerts:
@UltimaterMay 31.2006 — I've seen nothing that would support that statement.[/quote]
Are you suggesting you would rely on referrers even if it can be spoofed?
Copy linkTweet thisAlerts:
@phpnoviceJun 01.2006 — "rely" is an indefinite word. ? But that wasn't my point. My point was only about the normal source of a referrer. It is server defined, controlled, and transmitted. It is not visitor-controlled -- as was suggested. Sure, can be visitor-spoofed, but that is an abnormal source.
×

Success!

Help @damnhao spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...