Url from a form

Discussion in 'HTML' started by f8lerror@gmail.com, Nov 15, 2006.

  1. Guest

    Okay,
    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.

    <body>
    <form method=get form
    action="http://www.google.com/search?hl=en&lr=&safe=on ">
    <input name="s" size=30>
    <input type=submit>
    </form>
    </body>
    </html>
    thanks
     
    , Nov 15, 2006
    #1
    1. Advertising

  2. John Dunlop Guest

    :

    > <form method=get form
    > action="http://www.google.com/search?hl=en&lr=&safe=on ">


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

    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.

    site:google.com

    --
    Jock
     
    John Dunlop, Nov 15, 2006
    #2
    1. Advertising

  3. On 14 Nov 2006 23:37:08 -0800, wrote:

    > Okay,
    > 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.
    >


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

    <form method=get
    action="http://www.google.com/search">
    <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>
    </form>


    --
    Steven
     
    Steven Saunderson, Nov 15, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jon paugh
    Replies:
    1
    Views:
    883
  2. Just D.
    Replies:
    0
    Views:
    510
    Just D.
    Aug 11, 2004
  3. Rudi Ahlers
    Replies:
    11
    Views:
    847
    Aaron Bertrand [MVP]
    Apr 11, 2004
  4. Jared
    Replies:
    5
    Views:
    231
    Jared
    Jul 10, 2003
  5. castnblast
    Replies:
    0
    Views:
    89
    castnblast
    Dec 1, 2004
Loading...

Share This Page