![]() |
Check if Website Exists?
Hi guys, this is driving me crazy. I don't care which method I use, I just want it to work. How can I get my script to check if the user submitted article is accessible or not?
I can't figure out how I can get it to work with all of the possible urls www.website.com http://www.website.com https://www.website.com http://www.website.com/directory/index.php?id=2425 etc. Any help would be greatly appreciated :) |
|
Thank you, I managed to do it with curl. Turns out I had php errors turned off and php safe mode turned on.
I have another question now, is there any possible way to get the root domain out of a link? so if someone submits http://www.subdomain.domain.com/aasdg/bob/horse.html my script can somehow get www.domain.com |
http://www.php.net/parse_url should do the trick. It's a useful function but I keep forgetting its name...
|
I made a script like this for practice, I don't remember exactly what I had, but you would have to use a socket to ping the site, and on the site search it for a specific string. I did it with 2 functions that were small, so this shouldn't be much of a problem to pull off.
|
| All times are GMT. The time now is 08:34 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0