http referer

E

exxos

Hi all,

I'm trying to list to a html page where the referer is, There are a lot of
ways ive tried and work, but the problem if my mainpage uses frames, and no
matter where I do the referer check it just reports the website url, does
anyone know a cure or workaround other than trashing the frames ?

Cheers,
chris
 
E

Evertjan.

exxos wrote on 03 mrt 2005 in comp.lang.javascript:
I'm trying to list to a html page where the referer is, There are a
lot of ways ive tried and work, but the problem if my mainpage uses
frames, and no matter where I do the referer check it just reports the
website url, does anyone know a cure or workaround other than trashing
the frames ?

Then that really is the referer.
Frames are evil, trash them anyway.

Cann't you get the referrer on the main frameset page?
 
E

exxos

Evertjan. said:
exxos wrote on 03 mrt 2005 in comp.lang.javascript:

Then that really is the referer.
Frames are evil, trash them anyway.

Cann't you get the referrer on the main frameset page?

I managed to get in in the frameset, though im trying to match the referer
to itself to see if this works...


if (document.referrer&&document.referrer!=document.referrer)
alert('Found');


might be setout wrong ? though the referer will always match itself (I
assume) so it should flag up the alter box.. but dont do a thing.... if I
flag up a alert for the referer thats correct...... *lost* ?!

Chris
 
E

Evertjan.

exxos wrote on 03 mrt 2005 in comp.lang.javascript:
if (document.referrer&&document.referrer!=document.referrer)
alert('Found');


might be setout wrong ? though the referer will always match itself (I
assume) so it should flag up the alter box.. but dont do a thing....
if I flag up a alert for the referer thats correct...... *lost* ?!

No it does not!!

(document.referrer&&document.referrer!=document.referrer)

pseudocode:

if "document.referrer" is not true then NO alert

"document.referrer!=document.referrer" this is never true, so always false

if "document.referrer" is true then
if false then again NO alert()

Conclusion: alert() never fires at all.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top