⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 features.xforms.html

📁 php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>Dealing with XForms</title>  <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="features.sessions.html">Sessions</a></div> <div class="next" style="text-align: right; float: right;"><a href="features.file-upload.html">Handling file uploads</a></div> <div class="up"><a href="features.html">Features</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div> <h1>Dealing with XForms</h1> <p class="para">  <a href="http://www.w3.org/MarkUp/Forms/" class="link external">&raquo; XForms</a> 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. </p> <p class="para">  The first key difference in XForms is how the form is sent to the client.  <a href="http://www.w3.org/MarkUp/Forms/2003/xforms-for-html-authors.html" class="link external">&raquo; XForms for HTML Authors</a>  contains a detailed description of how to create XForms, for the purpose  of this tutorial we&#039;ll only be looking at a simple example. </p> <div class="example">  <p><b>Example #1 A simple XForms search form</b></p>  <div class="example-contents"><div class="cdata"><pre>&lt;h:html xmlns:h=&quot;http://www.w3.org/1999/xhtml&quot;        xmlns=&quot;http://www.w3.org/2002/xforms&quot;&gt;&lt;h:head&gt; &lt;h:title&gt;Search&lt;/h:title&gt; &lt;model&gt;  &lt;submission action=&quot;http://example.com/search&quot;              method=&quot;post&quot; id=&quot;s&quot;/&gt; &lt;/model&gt;&lt;/h:head&gt;&lt;h:body&gt; &lt;h:p&gt;  &lt;input ref=&quot;q&quot;&gt;&lt;label&gt;Find&lt;/label&gt;&lt;/input&gt;  &lt;submit submission=&quot;s&quot;&gt;&lt;label&gt;Go&lt;/label&gt;&lt;/submit&gt; &lt;/h:p&gt;&lt;/h:body&gt;&lt;/h:html&gt;</pre></div>  </div> </div> <p class="para">  The above form displays a text input box (named <i><tt class="parameter">q</tt></i>),  and a submit button.  When the submit button is clicked, the form will be  sent to the page referred to by <i>action</i>. </p> <p class="para">  Here&#039;s where it starts to look different from your web application&#039;s point  of view.  In a normal HTML form, the data would be sent as   <i>application/x-www-form-urlencoded</i>, in the XForms world  however, this information is sent as XML formatted data. </p> <p class="para">  If you&#039;re choosing to work with XForms then you probably want that data as  XML, in that case, look in <var class="varname"><a href="reserved.variables.httprawpostdata.html" class="classname">$HTTP_RAW_POST_DATA</a></var> where  you&#039;ll find the XML document generated by the browser which you can pass  into your favorite XSLT engine or document parser. </p> <p class="para">  If you&#039;re not interested in formatting and just want your data to be loaded  into the traditional <var class="varname"><a href="reserved.variables.post.html" class="classname">$_POST</a></var> variable, you can instruct  the client browser to send it as <i>application/x-www-form-urlencoded</i>  by changing the <i><tt class="parameter">method</tt></i> attribute to  <em class="emphasis">urlencoded-post</em>. </p> <div class="example">  <p><b>Example #2 Using an XForm to populate <var class="varname"><a href="reserved.variables.post.html" class="classname">$_POST</a></var></b></p>  <div class="example-contents"><div class="cdata"><pre>&lt;h:html xmlns:h=&quot;http://www.w3.org/1999/xhtml&quot;        xmlns=&quot;http://www.w3.org/2002/xforms&quot;&gt;&lt;h:head&gt; &lt;h:title&gt;Search&lt;/h:title&gt; &lt;model&gt;  &lt;submission action=&quot;http://example.com/search&quot;              method=&quot;urlencoded-post&quot; id=&quot;s&quot;/&gt; &lt;/model&gt;&lt;/h:head&gt;&lt;h:body&gt; &lt;h:p&gt;  &lt;input ref=&quot;q&quot;&gt;&lt;label&gt;Find&lt;/label&gt;&lt;/input&gt;  &lt;submit submission=&quot;s&quot;&gt;&lt;label&gt;Go&lt;/label&gt;&lt;/submit&gt; &lt;/h:p&gt;&lt;/h:body&gt;&lt;/h:html&gt;</pre></div>  </div> </div> <blockquote><p><b class="note">Note</b>:   <span class="simpara">   As of this writing, many browsers do not support XForms.   Check your browser version if the above examples fails.  </span> </p></blockquote></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="features.sessions.html">Sessions</a></div> <div class="next" style="text-align: right; float: right;"><a href="features.file-upload.html">Handling file uploads</a></div> <div class="up"><a href="features.html">Features</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -