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
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..
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.