|
Posted by chinese.central on 11/21/06 10:59
Thanks a lot for your reply.
But for example, google, only 1 text field
http://www.google.co.uk/search?hl=en&q=html&btnG=Search&meta=
How does this general strategy work?
Regards,
Ben
N.B. I want to do some validation and syntax checking before the stuffs
appear on the URL, any trick to do that?
Jukka K. Korpela wrote:
> Scripsit chinese.central@googlemail.com:
>
> > I have got a form, it has a text field, I type in ;-delimited data,
>
> The ";" will be % encoded, and so will any other reserved characters, such
> as "=".
>
> > is there a way that I can parse the data such that the URL will look like
> >
> > .php?field1=xxx,field1_hidden=xxx,field2=xxx,field2_hidden=xxx
>
> _You_ don't "parse" the data. The browser will "parse" (actually, just
> process, % encode) it when constructing the form data set. If the user
> types, say,
> foo=bar;zap=zap
> into a field named "q", then (assuming method="GET") the URL that the
> browser constructs will have a query part with
> ?q=foo%3Dbar%3Bzap%3Dzap
>
> You have to take it from there. Any normal form data processing on the
> server will start with dividing the query part into name=value fields,
> followed by % decoding, through some library routine, turning %3D to "=" and
> %3B to ";". Then you can simply parse that. You cannot and you need not
> parse the data to make the _URL_ look something particular. The URL is your
> input data, not output.
>
> --
> Jukka K. Korpela ("Yucca")
> http://www.cs.tut.fi/~jkorpela/
Navigation:
[Reply to this message]
|