PHP Classes

Example doesn't work

Recommend this page to a friend!

      Remote Form  >  All threads  >  Example doesn't work  >  (Un) Subscribe thread alerts  
Subject:Example doesn't work
Summary:Example doesn't work
Messages:5
Author:Roy Yu
Date:2009-07-10 00:11:03
Update:2009-10-15 01:52:55
 

  1. Example doesn't work   Reply   Report abuse  
Picture of Roy Yu Roy Yu - 2009-07-10 00:11:03
Hi,

This is a great class.

But I tried to download your code and example (where your example use gmail), and test it on my server.

This is the error message I got.


Warning: DOMDocument::loadHTML() [function.DOMDocument-loadHTML]: htmlParseEntityRef: expecting ';' in Entity, line: 105 in /var/www/sites/projects/testing/remoteform.php on line 6

Warning: DOMDocument::loadHTML() [function.DOMDocument-loadHTML]: Unexpected end tag : img in Entity, line: 196 in /var/www/sites/projects/testing/remoteform.php on line 6

Warning: DOMDocument::loadHTML() [function.DOMDocument-loadHTML]: htmlParseEntityRef: expecting ';' in Entity, line: 395 in /var/www/sites/projects/testing/remoteform.php on line 6

Warning: DOMDocument::loadHTML() [function.DOMDocument-loadHTML]: htmlParseEntityRef: expecting ';' in Entity, line: 395 in /var/www/sites/projects/testing/remoteform.php on line 6

Warning: DOMDocument::loadHTML() [function.DOMDocument-loadHTML]: htmlParseEntityRef: expecting ';' in Entity, line: 395 in /var/www/sites/projects/testing/remoteform.php on line 6

Warning: DOMDocument::loadHTML() [function.DOMDocument-loadHTML]: htmlParseEntityRef: expecting ';' in Entity, line: 396 in /var/www/sites/projects/testing/remoteform.php on line 6

Warning: DOMDocument::loadHTML() [function.DOMDocument-loadHTML]: htmlParseEntityRef: expecting ';' in Entity, line: 396 in /var/www/sites/projects/testing/remoteform.php on line 6

Catchable fatal error: Argument 1 passed to RemoteForm::__construct() must be an instance of DOMElement, null given, called in /var/www/sites/projects/testing/remoteform.php on line 8 and defined in /var/www/sites/projects/testing/remoteform.class.php on line 32


  2. Re: Example doesn't work   Reply   Report abuse  
Picture of Jon Gjengset Jon Gjengset - 2009-07-10 09:28:08 - In reply to message 1 from Roy Yu
Hmm.. It seems like you're not receiving a valid HTML reply from the server... Try dumping the source with getSource() before the step that fails, and see what it prints out..

  3. Re: Example doesn't work   Reply   Report abuse  
Picture of Roy Yu Roy Yu - 2009-07-10 17:02:49 - In reply to message 2 from Jon Gjengset
I print the $site, and it is the gmail website.

So it means that file_get_contents totally works fine.

And the problem as the error message indicates...

$dom->loadHTML($site);

I think I need to check the DomDocument documentations instead.

But wonder if you have any idea on that, thanks.

  4. Re: Example doesn't work   Reply   Report abuse  
Picture of Stephen Stephen - 2009-10-15 00:57:37 - In reply to message 2 from Jon Gjengset
Howdy;

I have the exact same error as well.

Any ideas?

  5. Re: Example doesn't work   Reply   Report abuse  
Picture of Jon Gjengset Jon Gjengset - 2009-10-15 01:52:55 - In reply to message 4 from Stephen
Hmm.. From what you're describing it seems as DOMDocument cannot parse the response it receives from the server as valid HTML..? Could you upload the dump of the page and the script you use to get it, so I can test it on this end?

 
For more information send a message to info at phpclasses dot org.