Unstoppable Domains — Expired Auctions

[Php] Scanning a web site

SpaceshipSpaceship
Watch

Alex.

Account Closed
Impact
5
hi, another php question.
i need a script that scans a site for two pieces of html code, then, when it's scanned it, it performs an action based on wiether it found the either of the code segmants.

thanks in advance!
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
this should do the job

Code:
<?php

//Pieces of code to search for
$code1 = "<p>";
$code2 = "<body>";

//Grabs content from desired url
$content=file_get_contents("http://www.google.com");

//Searches content for pieces of code
if (strstr($content, $code1) || strstr($content, $code2)) {
// action here
echo "code string found";
} 

?>
 
1
•••
PHP:
@$file = file_get_contents("http://www.whatever.com/page.html");
if(preg_match("#<sometag>(.*?)</sometag>#s",$file,$bla)){ 
   //do this
}
Is possibly one way of doing it if you need to return the value too
 
1
•••
thanks both of you.
youve answered my question, rep added :)
 
0
•••
Dynadot — .com TransferDynadot — .com Transfer

We're social

Spaceship
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back