Re: XForms: urlencoded-post encoding wrong?
Aaron Reed <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.xml |
|---|---|
| Organization | Another Netscape Collabra Server User |
| Message-ID | <[email protected]> |
Eric Hanson wrote: > Hi, > > First time Mozilla XForms user, very exciting stuff... > > Question -- is method="urlencoded-post" supposed to be delmiting > name/value pairs with semicolons? PHP doesn't seem to like this, and > ends up only getting the very first var, for example $_POST['foo'] gets > set to: > > asdfasdf;bar=howdy;wang=asfdasf; > > and $_POST['bar'] and $_POST['wang'] don't get set at all. Seemed a > little weird to me. "Normal" HTML forms seperate n/v pairs with an > ampersand. Here's a full header dump: > > > POST /foo.php HTTP/1.1 > Host: 24.22.56.63:8080 > User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) > Gecko/2005 > 0507 Firefox/1.0+ > Accept: > text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 > Accept-Language: en-us,en;q=0.5 > Accept-Encoding: gzip,deflate > Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 > Keep-Alive: 300 > Connection: keep-alive > Content-Length: 39 > Content-Type: application/x-www-form-urlencoded > > foo=asdfasdf;bar=howdy%21;wank=asfdasf; > > > > > Also, when I switch to method="post", the submit button suddenly does > nothing. Any ideas on this? Here's the 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> > <instance><data xmlns=""> > <foo/> > <bar>howdy!</bar> > <wank att="ribute" /> > </data></instance> > <submission action="http://24.22.56.63:8080/foo.php" > method="urlencoded-post" id="s" /> > </model> > </h:head> > <h:body> > <h:p> > <input ref="foo"><label>Foo</label></input> > <input ref="bar"><label>Bar</label></input> > <input ref="wank"><label>Wank</label></input> > <submit submission="s"><label>Submit!</label></submit> > </h:p> > </h:body> > </h:html> > > Thanks, > Eric > Hey Eric, With your "post" bug, if you look in your JS Console and see an error like: Security check failed! Trying to submit data to a different domain than document", you are trying to submit data to a server that is different from the server that the original form was served from which is a violation of the mozilla security model. You can allow for this behavior by changing your hostperm.1 file as is noted in bug: https://bugzilla.mozilla.org/show_bug.cgi?id=284519 Hope this helps, --Aaron