Web Coding Question

Discussion in 'General Off-Topic Chat' started by raiderscrusade, Mar 5, 2010.

  1. raiderscrusade
    OP

    raiderscrusade GBAtemp Fan

    Member
    433
    1
    Jun 30, 2009
    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 [​IMG]
     
  2. Wabsta

    Wabsta you fight like a dairy farmer

    Member
    2,498
    69
    Apr 25, 2008
    Netherlands
    SCUMM Bar
    I never really worked with it, but you could probably write this in a cookie.
    I think that's your best option.
     
  3. raiderscrusade
    OP

    raiderscrusade GBAtemp Fan

    Member
    433
    1
    Jun 30, 2009
    I have no idea on how to write a cookie [​IMG]

    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.
     
  4. Cyan

    Cyan GBATemp's lurking knight

    Global Moderator
    17,305
    7,882
    Oct 27, 2002
    France
    Engine room, learning
    • 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.
     
  5. John Lennon

    John Lennon Member

    Newcomer
    11
    0
    Jan 17, 2008
    if i may ask
    why do you want to cyber-stalk your site's visitors?
     
  6. tj_cool

    tj_cool Site dev

    Supervisor
    9,984
    -1
    Jan 7, 2009
    Belgium
    This planet
    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?
     
  7. raiderscrusade
    OP

    raiderscrusade GBAtemp Fan

    Member
    433
    1
    Jun 30, 2009
    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.
     
  8. Cyan

    Cyan GBATemp's lurking knight

    Global Moderator
    17,305
    7,882
    Oct 27, 2002
    France
    Engine room, learning
    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)