Url from a form

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
You know how you can use google to search for things and use
+description or -adult stuff like that
how can I have a user enter whatever into a form and add the input to
the end of a search string that I made up I either get an error from
google or a blank google page.

<form method=get form
action="http://www.google.com/search?hl=en&lr=&safe=on ">
<input name="s" size=30>
<input type=submit>

Re: Url from a form


Quoted text here. Click to load it

  This is problematic.  'If the method is "get" and the action is an
HTTP URI, the user agent takes the value of action, appends a `?' to
it, then appends the form data set'.  So if the URL in the action
attribute already has a query part, the URL created by the form will
have two question marks.  The second question mark, the one actually
_in_ the query part, is data rather than a delimiter.  To take your
example, with a non-empty form data set, the 'safe' variable - assuming
"variables" are separated by '&' - would have a value of 'on?' plus the
control-name, '=', and control-value of the first item in the form data

  There is no single production in the URI std that the HTML spec could
have pointed to to say 'the value of the action attribute must be
this'.  What it could have said was that if the method is GET then the
URL in the action attribute must not have a query part.



Re: Url from a form

On 14 Nov 2006 23:37:08 -0800, f8lerror@gmail.com wrote:

Quoted text here. Click to load it

Can you try hidden fields before or after your text field ?

<form method=get
<input type="hidden" name="h1" value="en">
<input type="hidden" name="lr" value="">
<input type="hidden" name="safe" value="on">
<input name="s" size=30>
<input type=submit>


Site Timeline