Najnowsze wypowiedzi

Napisane przez użytkowników:

[Praca oferowana / wspó³praca] Programista C/C++
Dla naszego klienta du¿ej miêdzynarodowej firmy poszukujemy osób na stanowisko Programista/ Team Leader Lokalizacja Warszawa Wymagane: -roczne do¶wiadczenie C/C++ -znajomo¶æ jêzyka...
[Praca oferowana / wspó³praca] Programista RPG
Dla naszego klienta du¿ej instytucji finansowej poszukujemy osoby na stanowisko Programista Wymagane do¶wiadczenie w programowaniu RPG. Lokalizacja Poznañ Osoby zainteresowane proszê o...
[Praca oferowana / wspó³praca] Software Implementation Manager Java
Witam serdecznie Dla naszego klienta firmy konsultingowej poszukujemy osob na stanowisko Software Implementation Manager Lokalizacja: Warszawa Wymagania: - 2 lata do¶wiadczenia w...
[Praca oferowana / wspó³praca] Programista PL/SQL Oracle
Dla naszego klienta dostawcy systemow ERP, poszukujemy osob na stanowiska Software Developera. Lokalizacja: Poznan, Gdansk Wymagania doswiadczenie w programowaniu w PL/SQL, Java znajomosc...
[VBA i OOoB] [Excel] Zliczanie konkretnej warto¶ci z pliku textowego
Cze¶æ Wszystkim, mam taki problem; potrzebuje do excel'a za pomoc± makra zliczyæ ilo¶æ wierszy z pliku tekstowego dla których w pewnej kolumnie wystepuje jaka¶ warto¶æ. (plik textowy rozdzialony...

Nauka PHP

Kurs w celu przybliżenia języka jakim jest php.



Dealing with XForms

Rozdział 37. 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.

Przykład 37-1. A simple XForms search form

<h:html xmlns:h="http://www.w3.org/1999/xhtml"
        xmlns="http://www.w3.org/2002/xforms">
<h:head>
 <h:title>Search</h:title>
 <model>
  <submission action="http://example.com/search"
              method="post" id="s"/>
 </model>
</h:head>
<h:body>
 <h:p>
  <input ref="q"><label>Find</label></input>
  <submit submission="s"><label>Go</label></submit>
 </h:p>
</h:body>
</h:html>

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 interested 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.

Przykład 37-2. Using an XForm to populate $_POST

<h:html xmlns:h="http://www.w3.org/1999/xhtml"
        xmlns="http://www.w3.org/2002/xforms">
<h:head>
 <h:title>Search</h:title>
 <model>
  <submission action="http://example.com/search"
              method="urlencoded-post" id="s"/>
 </model>
</h:head>
<h:body>
 <h:p>
  <input ref="q"><label>Find</label></input>
  <submit submission="s"><label>Go</label></submit>
 </h:p>
</h:body>
</h:html>

Notatka: As of this writing, many browsers do not support XForms. Check your browser version if the above examples fails.

Ciekawe informacje

Najciekawsze informacje znalezione w sieci

Obsługa wielowątkowości, jak to wykonać, przykład gdy wątki próbują robić coś równocześnie (jak temu zapobiec, lub jak to obsłużyć) np w przypadku obiektu klasy RECORDSET jeden cos tam jeszcze myka pobiera, się wcina i przed pobraniem następuje zamkniecie (close()) obiektu recordset.