You are here: Re: DOM doc - simple find element « PHP Programming Language « IT news, forums, messages
Re: DOM doc - simple find element

Posted by one man army on 01/18/06 20:52

In article <newsAT-93280A.09494218012006@newsclstr02.news.prodigy.com>,
one man army <newsAT@screenlightDOT.com> wrote:

> Hi All-
> I am new to PHP. I found FAQTS and the php manual. I am trying this
> sequence, but getting 'no zip string found:'... PHP Version 4.4.0
>
> $doc = new DomDocument;
> $res = $doc->loadHTMLFile("./aBasicSearchResult.html");
> if ( $res == true )
> {
> $zip = $doc->getElementById('zipRaw_id')->value;
> if ( 0 != $zip ) {
> ... stuff that works
> } else {
> $res = "no zip string found: " . $zip;
> }
> } else {
> $res = "loadHTMLFile() returned false";
> }
>
> -----
> in Javascript, this works in the doc
>
> setTextContent( getElementById_s('divZipCheckRes'),
> getElementById_s('zipRaw_id').value );
>
> getElementById_s() is a cover func for browser compatability..
>
> -----
> I just tried these variations
>
> $elem = $doc->getElementById('zipRaw_id');
> //$zip = $elem->getAttribute( 'value' );
> $zip = $elem->innerText;
>
> still nothing
> any clues?? thanks in advance
>
> ====
> PHP Version 4.4.0

btw- the element is an <INPUT type="text"> within a form. There is only
one ID by that name, and only one INPUT in the form. A Very Simple Page.

 

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

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