I'm not sure if this is the right forum for this, but I didnt see a mailing 
list for anything else similar, but Im trying to extract some info from 
another site using this code:  (code is partially displayed, if you need the 
whole thing, just e-mail me)

function get_result() { 
   $file=fopen($this->filename,"r");
   if(!$file) {  
     echo "<p>Impossible</p>.\n"; 
     exit;
   }
   while(!feof($file)) {
    $line=fgets($file,1024);

    if (eregi("<td>description</td><td>(.*)</td>", $line, $tab)) $this->
description =$tab[1];
    if (eregi("<td>web site</td><td>(.*)</td>", $line, $tab)) $this->website 
= $tab[1];
    if (eregi("<tr><td>members</td><td>(.*)</td>", $line, $tab)) $memb = 
$tab[1];
    if (eregi("<td>results received</td><td>(.*)</td>", $line, $tab)) $this->
results = $tab[1];
    if (eregi("<td>total cpu time</td><td>(.*)</td>", $line, $tab)) $this->
totalcputime = $tab[1];
       if (eregi("<td>founder</td><td>(.*)</td></tr>",$line, $tab)) $this->
founder = $tab[1];
    }

And this a sample of what Im trying to extract:

<tr><td>Description</td><td>Who ever said the aliens are trying to contact 
humans, maybe they recognize the canine as the superior species on this 
planet!</td></tr>
<tr><td>Web site</td><td> <a href=http://www.littlewhitedog.com>click here</a>
</td></tr>
<tr><td>Members</td><td> 198</td></tr>
<tr><td>Results received</td><td> 101729</td></tr>
<tr><td>Total CPU time</td><td>   138.611 years</td></tr>
<tr><td>Founder</td><td>


I have no problems with the description, website, results recieved or total 
CPU time, it just doesnt display the members part, or the founder name.  If 
anyone could help me out with this I would appreciate it.  If not could you 
point me in the right direction?  BTW Im running this on win2k with IIS5 and 
php 4.0.6 (I think)  Thanks in advance

~Jeff

Reply via email to