Get previous page URL!

Discussion in 'PHP' started by fotrino, Feb 29, 2008.

  1. #1
    I've a problem and maybe you can help me.
    Lets say im on Page1 (its any random page. not mine so i cant modify it) and I've in the bookmarks Page2 (which is actually the page i created) .... There is anyway that when I click on the bookmarks I can display in a submit Form the Page1 URL ?

    Thank you.
    Facuz
     
    fotrino, Feb 29, 2008 IP
  2. RoscoeT

    RoscoeT Peon

    Messages:
    78
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I don't think so. If I understand what you are asking that would be a security problem in the browser side.

    I might not understand your question though, can you explain it a bit better?
     
    RoscoeT, Feb 29, 2008 IP
  3. fotrino

    fotrino Active Member

    Messages:
    285
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    60
    #3
    Lets say Im on PAGE1 (which is any page, like google, ebay, etc .. in my case for myspace bulletins) ...
    And you have bookmarked PAGE2 which is actually the page im creating and i want to display in a submit form the page where i used to be which was PAGE1.
    Whats the point of this ... that this submit form then will shorten the url till the point i need it for myspace bulletins.

    I could copy and paste the url in the submit form but i want that it autotake it from the last url i was to make the process faster.

    Thanks.
    Facuz
     
    fotrino, Feb 29, 2008 IP
  4. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #4
    Use referral server variable:

    $_SERVER['referral']

    Peace,
     
    Barti1987, Feb 29, 2008 IP
  5. Wuiqed

    Wuiqed Well-Known Member

    Messages:
    110
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    108
    #5
    It's $_SERVER['HTTP_REFERER'].

    But it won't work, seeing as a bookmark isn't a referer. Sorry fotrino, as far as I know what you want isn't possible.
     
    Wuiqed, Feb 29, 2008 IP
  6. jnestor

    jnestor Peon

    Messages:
    133
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Do you control the bookmark? In other words are you giving out the bookmark or using it for your own personal use? If so you can create a bookmarklet written in javascript that will get the current url and pass it to your page.

    In general though you can get the referrer (sometimes) if the user clicks through on a link to your page but if the user follows a bookmark or types in the url of your page you won't get any information about their previous page.
     
    jnestor, Feb 29, 2008 IP
  7. fotrino

    fotrino Active Member

    Messages:
    285
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    60
    #7
    Yes its for personal use.
    and basically for saving me the trouble of copy and paste everytime i want to put the url i was in the new one.
    So can u help me out with that java script please?
    I'd like to get the url from page one and put it in a form on page 2 or just to make it more easy to include that gotten url into the php i already have.
     
    fotrino, Feb 29, 2008 IP
  8. jnestor

    jnestor Peon

    Messages:
    133
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #8
    This should do it though I haven't tested it.

    javascript:location.href='http://example.com/whatever.php?url='+escape(location.href)
     
    jnestor, Feb 29, 2008 IP
  9. fotrino

    fotrino Active Member

    Messages:
    285
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    60
    #9
    Thanks for your help.
    But this redirects me to certain webpage.
    What i'd like is that in a INPUT Form the URL where i was (page1) would be displayed ...
     
    fotrino, Mar 1, 2008 IP