Web Coding Question

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

Mar 5, 2010

Web Coding Question by raiderscrusade at 6:39 AM (934 Views / 0 Likes) 7 replies

  1. raiderscrusade
    OP

    Member raiderscrusade GBAtemp Fan

    Joined:
    Jun 30, 2009
    Messages:
    433
    Country:
    Australia
    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

    Member Wabsta you fight like a dairy farmer

    Joined:
    Apr 25, 2008
    Messages:
    2,485
    Location:
    SCUMM Bar
    Country:
    Netherlands
    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

    Member raiderscrusade GBAtemp Fan

    Joined:
    Jun 30, 2009
    Messages:
    433
    Country:
    Australia
    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

    Global Moderator Cyan GBATemp's lurking knight

    Joined:
    Oct 27, 2002
    Messages:
    16,407
    Location:
    Engine room, learning
    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.
     
  5. John Lennon

    Newcomer John Lennon Member

    Joined:
    Jan 17, 2008
    Messages:
    11
    Country:
    Australia
    if i may ask
    why do you want to cyber-stalk your site's visitors?
     
  6. tj_cool

    Supervisor tj_cool Stuff

    Joined:
    Jan 7, 2009
    Messages:
    9,942
    Location:
    This planet
    Country:
    Belgium
    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

    Member raiderscrusade GBAtemp Fan

    Joined:
    Jun 30, 2009
    Messages:
    433
    Country:
    Australia
    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

    Global Moderator Cyan GBATemp's lurking knight

    Joined:
    Oct 27, 2002
    Messages:
    16,407
    Location:
    Engine room, learning
    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)
     

Share This Page