From 29ff31d8649e1435ea155edd264b0a14b746dde7 Mon Sep 17 00:00:00 2001 From: Sara Golemon Date: Fri, 20 Feb 2004 18:05:32 +0000 Subject: [PATCH] New Documentation: Dealing with XForms git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@151953 c90b9560-bf6c-de11-be94-00142212c4b1 --- chapters/tutorial.xml | 92 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 91 insertions(+), 1 deletion(-) diff --git a/chapters/tutorial.xml b/chapters/tutorial.xml index 7214f693a8..a99671c514 100644 --- a/chapters/tutorial.xml +++ b/chapters/tutorial.xml @@ -1,5 +1,5 @@ - + A simple tutorial @@ -424,6 +424,96 @@ Hi Joe. You are 22 years old. import_request_variables function. + + + Dealing with XForms + + XForms defines a variation on traditional + webforms which allows them to be used on a wider variety of platforms and + browsers or even non-traditional media such as PDF documents. + + + The first key difference in xforms is how the form is sent to the client. + XForms for HTML Authors + contains a detailed description of how to create XForms, for the purpose + of this tutorial we'll only be looking at a simple example. + + + A simple XForms search form + + + + Search + + + + + + + + + + + +]]> + + + + The above form displays a text input box (named q), + and a submit button. When the submit button is clicked, the form will be + sent to the page referred to by action. + + + Here's where it starts to look different from your web application's point + of view. In a normal HTML form, the data would be sent as + application/x-www-form-urlencoded, in the XForms world however, this information + is sent as XML formatted data. + + + If you're choosing to work with XForms then you probably want that data as + XML, in that case, look in $HTTP_RAW_POST_DATA where you'll find the XML + document generated by the browser which you can pass into your favorite + XSLT engine or document parser. + + + If you're not interrested in formatting and just want your data to be loaded + into the traditional $_POST variable, you can instruct the client browser + to send it as application/x-www-form-urlencoded by changing the + method attribute to urlencoded-post. + + + Using an XForm to populate $_POST + + + + Search + + + + + + + + + + + +]]> + + + + + As of this writing, many browsers do not support XForms. + Check your browser version if the above examples fail. + + + Using old code with new versions of PHP