Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Url from a form

Reply
Thread Tools

Url from a form

 
 
f8lerror@gmail.com
Guest
Posts: n/a
 
      11-15-2006
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

 
Reply With Quote
 
 
 
 
John Dunlop
Guest
Posts: n/a
 
      11-15-2006
http://www.velocityreviews.com/forums/(E-Mail Removed):

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

 
Reply With Quote
 
 
 
 
Steven Saunderson
Guest
Posts: n/a
 
      11-15-2006
On 14 Nov 2006 23:37:08 -0800, (E-Mail Removed) 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
right button click on any URL posts that url to a server-side form castnblast Javascript 0 12-01-2004 10:12 PM
URL - substitution of a correct URL by a GUID like URL in favorites. Just D. ASP .Net Mobile 0 08-11-2004 04:26 PM
redirect URL's, return URL's, and URL Parameters Jon paugh ASP .Net 1 07-10-2004 05:29 AM
Invalid URL form or fully-qualified absolute URL was used. Use relative URLs Rudi Ahlers ASP General 11 04-11-2004 03:17 PM
Form Submission: Final URL that has form options included ?? Jared Javascript 5 07-10-2003 10:33 AM



Advertisments