Jump to content

[SOLVED] php script to check a domain.


Shaun

Recommended Posts

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

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.

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.