Unstoppable Domains โ€” Expired Auctions

How to automatically display URLs as page titles when posted elsewhere?

SpaceshipSpaceship
Watch

Miyavi

o-re-sa-maVIP Member
Impact
41
I've noticed that when I paste some URLs into forums, they automatically display the page title for that particular URL. Is that related to code, is it a forum feature, is it a browser feature?

For example, when I paste NamePros's URL in my post, I automatically get the following:
NamePros - Buy, Sell, Discover Domain Names

Thanks.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
It is a forum featured, and you can actually change it to whatever you want.
 
0
•••
I know I can change it to whatever I want by using the forum's URL tags, but I don't understand why some URLs automatically show up as that URL's page title and some simply display the URL.
 
0
•••
Probably because the function only sets aside X seconds to retrieve the page title, if the URL is slower, it would just ignore it.

Anyway, they just retrieve the page and then do a regex on it like so:

PHP:
preg_match('/<title>([^>]*)<\/title>/si', $contents, $match );
 
1
•••
Ah, that makes sense. Thank you for the explanation. :tu:
 
0
•••
Spaceship
Domain Recover
CatchDoms
DomainEasy โ€” Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back