Web Coding Question

raiderscrusade

Well-Known Member
Member
Joined
Jun 30, 2009
Messages
433
Trophies
0
XP
155
Country
Hello all,

I am a beginner to PHP and JavaScript and am wanting to know whether PHP (or JavaScript) can get and write all the previous websites visited in that same tab, when someone navigates to your page with the code on it.

Example:

When someone logs in, they go to login page:
" sitelogin.com "

They then get redirected but during the middle of the redirect a different URL is placed into the equation:
" sitelogin.com/session=blah " which shows for 1 second, then goes to "sitelogin.com/me"

They then visit my website, " mywebsite.com/track.php " which has the code to track previous visited websites.

If this is done in the same tab, is it possible to use the track.php code to write all the previous websites visited in the URL bar of that browser into a .txt file?

So, basically:
If you press control+z whilst clicked into the URL bar, you see the previous URLs. If you then go to mywebsite.com/track.php can a code track all the other previous URLs?

Sorry if this was complicated.

Thanks
smile.gif
 

raiderscrusade

Well-Known Member
Member
Joined
Jun 30, 2009
Messages
433
Trophies
0
XP
155
Country
wabsta said:
I never really worked with it, but you could probably write this in a cookie.
I think that's your best option.

I have no idea on how to write a cookie
smile.gif


And I'm trying to do it so that if someone visits my site, I get all the information on the websites they had been from before they visited my site.
 

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,422
Trophies
0
Age
43
Location
Engine room, learning
XP
14,460
Country
France
• you can use the referrer in PHP (but it only works if the user clicked on a link from the previous site to your trackpage, and the referrer is only 1 URL long)
• You can know the previously url typed in the URL location bar, using javascript.
That both method, I know how to do it.

The next one is only an idea, I don't know if the navigator gives you the privilege to read user data :
• Use the DOM explorer with javascript to access the navigator's menu and content.
 

raiderscrusade

Well-Known Member
Member
Joined
Jun 30, 2009
Messages
433
Trophies
0
XP
155
Country
tj_cool said:
try
HTMLGo Back
You can change the number to go back farther
And change it to + to go forward

Or do you want to save the locations somewhere?

I want to save the locations somewhere, preferably into a .txt file of my choice.

QUOTE(kaboose @ Mar 5 2010, 08:30 PM) if i may ask
why do you want to cyber-stalk your site's visitors?

I do not want to, it's just I have my own purpose to use this code lol. Basically, it is for educational use only and not to stalk people. I want to know how visitors got to my page.
 

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,422
Trophies
0
Age
43
Location
Engine room, learning
XP
14,460
Country
France
usually, the referer is enough for that purpose. You don't need to know the full history since the browser is opened (look, I usually leave a tab open for 1 month long)
 

Site & Scene News

General chit-chat
Help Users
    kenenthk @ kenenthk: This worker is walking out with stolen donut shoot to kill