Shaun Posted October 15, 2008 Share Posted October 15, 2008 Hi, im am absolutely lost with this. I am trying to make a php script that will check if a site in my database is actually valid. for example, $domain = "http://somedomain.com/?page=somepage&something=somethingelse"; I want to be able to connect to $domain and make sure that the url does actually point to the exact match that $domain is. The reason is that I have some sites in my database that use a php headers redirect and I cannot actually get the original domain without manually visiting each and every url in my db.. now this wouldnt be a problem with a small bd.. but I have a list of over 200k results.. so it will take me a very long time. I must apologise for not writing any code here, the only reason I havent tried is because i really do not have a clue where to start. I am thinking i will need to use fsocks, and $_SERVER['REMOTE_ADDR'] and one big loop, (for each etc) if anyone has the time, could you possible help me out with this? thank you so much, Shaun Link to comment https://forums.phpfreaks.com/topic/128522-solved-php-script-to-check-a-domain/ Share on other sites More sharing options...
MasterACE14 Posted October 15, 2008 Share Posted October 15, 2008 google "PHP Ping script", there is plenty of free scripts out there that do what your looking for. they 'ping' the server, first to see whether it is actually online/valid, and you can easily edit it from there to do whatever you need. Link to comment https://forums.phpfreaks.com/topic/128522-solved-php-script-to-check-a-domain/#findComment-666057 Share on other sites More sharing options...
Shaun Posted October 15, 2008 Author Share Posted October 15, 2008 Ive just found these set of functions that work perfectly http://w-shadow.com/blog/2008/07/05/how-to-get-redirect-url-in-php/ <- just incase anyone else is interested. Link to comment https://forums.phpfreaks.com/topic/128522-solved-php-script-to-check-a-domain/#findComment-666062 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.