View Single Post
Old 03-23-2009, 06:16 PM   #4 (permalink)
CrazeD
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,690

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: Script to compile direct mail list (not email) from online white pages.

Quote:
Originally Posted by office politics View Post
php should be able to load pages into memory. then you can parse the html code.

here's some things to play with

PHP Code:
//retrieve HTML code for a given address
function getPageSource($address) {
  
$page fopen($address,"r");
  
$source stream_get_contents($page);
  
fclose($page);
  return 
$source;
}

//
function getImgLine($html$find$break) {
  
$lines explode($break$html);
  foreach(
$lines as $data) {
    if(
substr_count($data$find)) {
      return 
$data;
      echo 
str_replace(">","",$data)."<br>";
    }
  }

Note that this will only work if fopen() is allowed to access external files in the php.ini.
__________________

Need website help? PM me!
CrazeD is offline