Reply to how to catch the execption of DOMDocument::load()

Your name:

Reply:


Posted by sunnyboyGuo on 01/09/08 10:00

Deal all,
When I use DOMDocument::load function to load one xml file, if this
file is not found, I want to give the 500 status to my client program
(not internet explorer).
But the load function will give some warning message and then I can
not rewrite the header because headers already sent.

How can I catch this exception and use header function to write header
information?
The code is as follows:

$DOC = new DOMDocument();
if ($DOC->load($some_file))
{
do something.
} else {
Header("http/1.1 500 Internal Server Error");
return;
}

thank you very much.

Best wishes,
Tony

[Back to original 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

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