Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Linux, Apache, MySQL, PHP
  4. determine page title

determine page title

Scheduled Pinned Locked Moved Linux, Apache, MySQL, PHP
questionphp
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jassim Rahma
    wrote on last edited by
    #1

    Hi, when you add a link in your Linkedin or facebook it will automatically determine the page title.. and when I say the title I don't mean the mata tag title but the real page title, that's what I have noticed.... so how can i do this using PHP? Thanks, Jassim

    S A 2 Replies Last reply
    0
    • J Jassim Rahma

      Hi, when you add a link in your Linkedin or facebook it will automatically determine the page title.. and when I say the title I don't mean the mata tag title but the real page title, that's what I have noticed.... so how can i do this using PHP? Thanks, Jassim

      S Offline
      S Offline
      Smithers Jones
      wrote on last edited by
      #2

      What do you mean? Something like this?

      Insert your title here  
      

      ";

      ?>

      "I love deadlines. I like the whooshing sound they make as they fly by." (DNA)

      J 2 Replies Last reply
      0
      • S Smithers Jones

        What do you mean? Something like this?

        Insert your title here  
        

        ";

        ?>

        "I love deadlines. I like the whooshing sound they make as they fly by." (DNA)

        J Offline
        J Offline
        Jassim Rahma
        wrote on last edited by
        #3

        no. try to login to your linkedin.. in your wall, click Attach a link and put any link there the you'll see linked has detected the web page title which is most of the times different than the tag title.. same if you go to facebook and type a link in your wall..

        1 Reply Last reply
        0
        • S Smithers Jones

          What do you mean? Something like this?

          Insert your title here  
          

          ";

          ?>

          "I love deadlines. I like the whooshing sound they make as they fly by." (DNA)

          J Offline
          J Offline
          Jassim Rahma
          wrote on last edited by
          #4

          for example.. if you you check this URL: http://x.co/bDHC[^] The title in the tag is: Android Hits 200 Million Activations - Mobility - Smartphones - Informationweek but when I type it in linkedin it will automatically detect the title as: Android Hits 200 Million Activations which is the article's title.. I am now sure if meta tag has anything to do with it because the source of the page shows:

          N 1 Reply Last reply
          0
          • J Jassim Rahma

            for example.. if you you check this URL: http://x.co/bDHC[^] The title in the tag is: Android Hits 200 Million Activations - Mobility - Smartphones - Informationweek but when I type it in linkedin it will automatically detect the title as: Android Hits 200 Million Activations which is the article's title.. I am now sure if meta tag has anything to do with it because the source of the page shows:

            N Offline
            N Offline
            Niall Barr
            wrote on last edited by
            #5

            The usual approach would be to look for the first heading tag using preg_match. You could also look for the tag. <meta> elements are usually only useful if you're looking at pages where you know that metadata has been added, and know the metadata profile that has been followed.</x-turndown>

            1 Reply Last reply
            0
            • J Jassim Rahma

              Hi, when you add a link in your Linkedin or facebook it will automatically determine the page title.. and when I say the title I don't mean the mata tag title but the real page title, that's what I have noticed.... so how can i do this using PHP? Thanks, Jassim

              A Offline
              A Offline
              afroxav
              wrote on last edited by
              #6

              What these websites do is load the website on the server and parse the received html to extract information such as the title. The probably use cURL in combination with some PREG regex.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups