Jump to content

Pinging and grabbing info from a website..


ChambeRFienD

Recommended Posts

I've heard of people being able to pull text from a website using fopen or something of the sort, but I'm looking to write a little PHP program to make my job go a bit faster at work. (We deal with a lot of domain names)

I was wondering if there was a way to ping a website with PHP and return the IP address of that site. I'm also looking for a way to pull the title from a website and return that if possible. Anyone have any ideas that could help me out?
Link to comment
https://forums.phpfreaks.com/topic/11911-pinging-and-grabbing-info-from-a-website/
Share on other sites

[!--quoteo(post=383437:date=Jun 13 2006, 03:49 PM:name=joquius)--][div class=\'quotetop\']QUOTE(joquius @ Jun 13 2006, 03:49 PM) [snapback]383437[/snapback][/div][div class=\'quotemain\'][!--quotec--]
@php.net:
[/quote]

Thanks much for that.. A lot easier than what I was thinking. I was heading more towards the system() function. =x

Using this now:

[code]<?
$host = 'lkasdflkawefhasdh.com';
$ip = gethostbyname($host);
if($ip == $host) {
    echo "Unable to find host.";
} else {
    echo $ip;
}
?>[/code]


Now to grab the titles from websites..

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.