You are here: Re: problem with some code.. « PHP Programming Language « IT news, forums, messages
Re: problem with some code..

Posted by Dave on 06/04/05 03:20

Craft (crafted@gmail.com) decided we needed to hear...
> have this code and I'm trying to get it to work. It mostly works, but
> $serverpop does not seem to work. What it looks to me like this code
> does is scan http://www.worldofwarcraft.com­/serverstatus/ for
> keywords
> and grab the information about the server that you're looking for. Can
> anyone help me try and get the $serverpop part to work?
>
<snip code>

> $serverpop = strtolower(substr(substr($html­, -(strlen($html) - ($pos
> +
> $length + 256))), 0, 3));
<snip>

It all seems like a pretty slack way of parsing HTML to me, and not
very robust if the HTML changes - its crying out for a rewrite ;)

Your problem with serverpop is probably to do with the number 256
above... seems like thats meant to step past all of those blanks
in the HTML to actually get to the <TD> that contains the value
required. You could try doing some manual char counting in the HTML
file and in/de-creasing the 256 as appropriate - or by trial and
error, which ever suits you.

--
Dave <dave@REMOVEbundook.com>
(Remove REMOVE for email address)

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация