Get Post url?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • maheswaran
    New Member
    • Mar 2007
    • 190

    Get Post url?

    Hi ,

    I want to get a post url. That is if we pass the value from one site to another i.e www.site1.com to www.site2.com. From www.site2.com i want to get a site name www.site1.com. Is there any function? from where values are getting?
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    #2
    [PHP]$_SERVER['HTTP_REFERER'][/PHP]
    The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted.

    Comment

    • mageswar005
      New Member
      • Mar 2008
      • 72

      #3
      hi maheshwaran,
      $_SERVER['HTTP_REFERER'] will help to get the previous page url....

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        Originally posted by mageswar005
        hi maheshwaran,
        $_SERVER['HTTP_REFERER'] will help to get the previous page url....
        Code Green has already suggested this.

        Comment

        • maheswaran
          New Member
          • Mar 2007
          • 190

          #5
          but this will not work in my case

          Comment

          • TheServant
            Recognized Expert Top Contributor
            • Feb 2008
            • 1168

            #6
            Originally posted by maheswaran
            but this will not work in my case
            What do you mean it won't work?
            Have you tried [php]<?php echo($_SERVER['HTTP_REFERER']); ?>[/php]

            Comment

            Working...