no, I dont think so!

look at this:

------------------ <snap> -------------------

$fp=fopen('http://www.vornamenlexikon.de/main/suchen.asp?kriterium=search&B1
=Suchen&action=searchnow&searchby='.$name,"r");
 if($fp){
  $daten=fread($fp,100000);
  fclose($fp);
  $male='/m.gif';
  $female='/w.gif';
  if((strpos($daten,$female)>0)&&(strpos($daten,$male)>0)){
   if(strpos($daten,$male)>strpos($daten,$female))$result='w';
   else $result='m';
  }else if(strpos($daten,$female)>0)$result='w';
  else if(strpos($daten,$male)>0)$result='m';
 }
 if(empty($result)){

$fp=fopen('http://www.kindername.de/'.strtolower(substr($name,0,1)).'-namen.
htm',"r");
  if($fp){
   $namen=array();
   $daten=fread($fp,100000);
   fclose($fp);

   $daten=strstr($daten,'<font size="4" face="Verdana, Arial, Helvetica,
sans-serif"><B>VORNAMEN MIT');
   for($cnt=0;strpos($daten,'<tr>')>0;$cnt++){
    $daten=substr(strstr($daten,'<tr>'),4);
    $tag=substr($daten,0,strpos($daten,'</tr>'));
    if(strpos($tag,'</td>')>0){
     $x1=substr(strstr($tag,'<td>'),4);
     while(strpos($x1,' ')>0)$x1=str_replace(' ',' ',$x1);//TAB
     while(strpos($x1,'  ')>0)$x1=str_replace('  ',' ',$x1);//DBLSPACE
     $x1=trim($x1);
     for($i=1;strpos($x1,'<td>')>0;$i++){

$field=strtolower(trim(strip_tags(substr($x1,0,strpos($x1,'</td>')))));
      if($i==1)$namen[$cnt]=array($field);
      else if($i==2)$namen[$cnt]['gender']=trim($field);
      else if($i==3){
       while(strpos($field,',')>0){
        array_push($namen[$cnt],substr($field,0,strpos($field,',')));
        $field=substr(strstr($field,','),1);
       }
       array_push($namen[$cnt],$field);
      }else if($i==4){
       if(in_array($name,$namen[$cnt]))$result=$namen[$cnt]['gender'];
      }
      $x1=substr(strstr($x1,'<td>'),4);
 } } } } }
------------------ </snap> -------------------

you can see... it works!

but just, because the target-url's realy exists!


its even not enough for me... the script above only scan german and some
english names.
russian ones like "dimitri" or names like "hassan", etc. are NOT included.

so I tryed to include this function

------------------ <snap> -------------------
 $fp=@fopen('http://babynames.pregnancy.yahoo.com/bnfname?n='.$name,"r");
 if($fp){
  $daten=fread($fp,10000);
  fclose($fp);
  $male='boy';
  $female='girl';
  if((strpos($daten,$female)>0)&&(strpos($daten,$male)>0)){
   if(strpos($daten,$male)>strpos($daten,$female))$result='w';
   else $result='m';
  }else if(strpos($daten,$female)>0)$result='w';
  else if(strpos($daten,$male)>0)$result='m';
 }
------------------ </snap> -------------------

but THIS one does'nt run, because the URL does not exist.
http://babynames.pregnancy.yahoo.com/bnfname?n=Patrick
or
http://babynames.pregnancy.yahoo.com/bnfname.htm?n=Patrick
http://babynames.pregnancy.yahoo.com/bnfname.?n=Patrick
http://babynames.pregnancy.yahoo.com/bnfnameBLABLA?n=Patrick
is all the saim and WORKS in a BROWSER... but not through the "fopen"
function.

HOW ?

... (or how else ?)

Tribun

PS: I know. its not the best english ;)

<[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> So you are trying to fopen that url? I made a similar
> post on this listserv about it.. I think it is a bug in
> PHP because you cannot pass the = sign into fopen or file.
>
>
> > Please help.
> >
> > http://babynames.pregnancy.yahoo.com/bnfname.htm?
> n=Patrick
> >
> > paste this into the browserbar and you'll see the
> result-page...
> >
> > but try this through the fopen function via PHP.
> >
> > I DONT get that! do YOU know any resolutions???
> >
> > my target is it: to get some informations about
> variable firstnames into
> > a variable.
> >
> > if this string contains "boy" i know the gender
> (else "girl")
> >
> > through this way i could skip the "gender" option in my
> > contact-formulars.
> >
> > e.g. for the personal message "thank you, mrS
> Jackson" ...
> >
> > i hope someone can help. thanks!
> >
> > Tribun
> > ---
> > www.mp3o.net
> >
> >
>
>
>
>
>
> ---------------------------------------------
> This message was sent using BurstNET® WebMail Pro.
> http://webmail.burst.net/
> BurstNET® - The Speed the Internet Travels®
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to