MozTips
- On Mozilla and Open Source Software
Recently Commented:
Previous Next

Posted on June 21, 2004 by jay_sheth. Edited: June 21, 2004 by jay_sheth.

PHP Architect on using XUL with PHP

The June, 2004 issue of the PHP Architect magazine has an interesting article on using XUL with PHP.

It examines the basic nature of a XUL file, and how XUL files can be generated and processed by PHP. The article looks at the PEAR XML_XUL library which can be used to generate XUL from PHP.

I skimmed the article last night, but did not find any references to using web services to exchange information between Mozilla and a PHP web server.

Since XUL-only documents do not incorporate the idea of the "submit" button from HTML forms, it is usually not possible to submit data to a PHP webserver from a XUL-only document without using web services. The author does mention how you can mix HTML elements with XUL elements - but from my current research, this approach seems not to be deemed the best way to create a XUL web application that interacts with a remote web server.

(On a slightly unrelated note, the summary of this article that appears in the electronic edition seems to be incorrect, i.e. it is the summary for another article that appears above this one. Additionally, some of the code samples are published with French language strings in them. Don't get me wrong - I like French fries, French people and crepes - but it would be good to have had these code snippets translated for people who don't know the Eiffel [tower] from truffles.)

Mozilla has built-in support for XML-RPC and SOAP, and so it seems that the natural way for Mozilla applications to exchange data with a remote web server would be to use one of these web services protocols. One could embed an HTML form with hidden form elements in a XUL document, and then use JavaScript to copy data that is filled into the XUL input elements into the hidden HTML form elements before the (embedded HTML) submit button is pressed ... but then again, this approach seems to be discouraged by more experienced XUL people.

Does anyone have experience on creating a XUL + PHP + MySQL web application? If so, which method did you use to exchange data? Did you use web services?

If there is no good tutorial on this subject yet, and if someone is willing to provide brief code snippets and descriptions to me, I would be willing to explore this subject further and create a complete tutorial.

Update: you can discuss article in the PHP Architect forums - http://www.phparch.com/discuss/index.php/t/650/851/



Category: Mozilla Applications

Comment: Read 2 comment(s)

Link: Permanent Link