Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > form method=post --> what are the query parameters in the url ?

Reply
Thread Tools

form method=post --> what are the query parameters in the url ?

 
 
bauhaus
Guest
Posts: n/a
 
      03-25-2009
I have a html page containing this form:

<form method="post" action="http://binsearch.info/fcgi/nzb.fcgi">
<input name="action" value="nzb">
<input value="NZB" type="submit">
</form>

When I load the html page in my browser and press the submit button, it
downloads a nzb file.

But how can I execute it directly from the url without pressing the submit
button, what are the parameters ?

I tried this: http://binsearch.info/fcgi/nzb.fcgi?action=nzb but then I get
the error: no parameters.

Any suggestions ?

 
Reply With Quote
 
 
 
 
rf
Guest
Posts: n/a
 
      03-26-2009
bauhaus wrote:
> I have a html page containing this form:
>
> <form method="post" action="http://binsearch.info/fcgi/nzb.fcgi">
> <input name="action" value="nzb">
> <input value="NZB" type="submit">
> </form>
>
> When I load the html page in my browser and press the submit button,
> it downloads a nzb file.
>
> But how can I execute it directly from the url without pressing the
> submit button, what are the parameters ?
>
> I tried this: http://binsearch.info/fcgi/nzb.fcgi?action=nzb but then
> I get the error: no parameters.


The server side script is *expecting* method=post.


 
Reply With Quote
 
 
 
 
Lars Eighner
Guest
Posts: n/a
 
      03-26-2009
In our last episode, <wEyyl.176017$(E-Mail Removed)2>, the lovely and
talented bauhaus broadcast on alt.html:

> I have a html page containing this form:


><form method="post" action="http://binsearch.info/fcgi/nzb.fcgi">
><input name="action" value="nzb">
><input value="NZB" type="submit">
></form>


> When I load the html page in my browser and press the submit button, it
> downloads a nzb file.


> But how can I execute it directly from the url without pressing the submit
> button, what are the parameters ?


You really need to get a basic understanding of the difference between
GET and POST. You cannot fake POST in the url.

> I tried this: http://binsearch.info/fcgi/nzb.fcgi?action=nzb but then I get
> the error: no parameters.


Because the method is POST, not GET.

> Any suggestions ?


--
Lars Eighner <http://larseighner.com/> http://www.velocityreviews.com/forums/(E-Mail Removed)
64 days since Rick Warren prayed over Bush's third term.
Obama: No hope, no change, more of the same. Yes, he can, but no, he won't.
 
Reply With Quote
 
Harlan Messinger
Guest
Posts: n/a
 
      03-26-2009
bauhaus wrote:
> I have a html page containing this form:
>
> <form method="post" action="http://binsearch.info/fcgi/nzb.fcgi">
> <input name="action" value="nzb">
> <input value="NZB" type="submit">
> </form>
>
> When I load the html page in my browser and press the submit button, it
> downloads a nzb file.
>
> But how can I execute it directly from the url without pressing the
> submit button, what are the parameters ?
>
> I tried this: http://binsearch.info/fcgi/nzb.fcgi?action=nzb but then I
> get the error: no parameters.
>
> Any suggestions ?


For that to work, the program nzb.fcgi has to check both the URL and the
body of the request to see if the expected parameters are present. If it
only checks the body of the request (which is where form control names
and values are placed), then you can't fake the form with URL parameters.
 
Reply With Quote
 
Andy
Guest
Posts: n/a
 
      03-26-2009

"Harlan Messinger" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> bauhaus wrote:
>> I have a html page containing this form:
>>
>> <form method="post" action="http://binsearch.info/fcgi/nzb.fcgi">
>> <input name="action" value="nzb">
>> <input value="NZB" type="submit">
>> </form>
>>
>> When I load the html page in my browser and press the submit button, it
>> downloads a nzb file.
>>
>> But how can I execute it directly from the url without pressing the
>> submit button, what are the parameters ?
>>
>> I tried this: http://binsearch.info/fcgi/nzb.fcgi?action=nzb but then I
>> get the error: no parameters.
>>
>> Any suggestions ?

>
> For that to work, the program nzb.fcgi has to check both the URL and the
> body of the request to see if the expected parameters are present. If it
> only checks the body of the request (which is where form control names and
> values are placed), then you can't fake the form with URL parameters.



This will work provided the user isn't one of those paranoid types that turn
off JavaScript...

<html>
<head>

<script language="JavaScript" type="text/JavaScript">
<!-- AUTO-SUBMIT FORM
function submit_form(){
document.myform.submit();
}
// - End of JavaScript - -->
</script>

</head>
<body onload="submit_form();">

<form name="myform" method="post"
action="http://binsearch.info/fcgi/nzb.fcgi">
<input name="action" value="nzb">
<input value="NZB" type="submit">
</form>

</body>
</html>


Hope this helps

Andy

 
Reply With Quote
 
bauhaus
Guest
Posts: n/a
 
      03-26-2009
> For that to work, the program nzb.fcgi has to check both the URL and the
> body of the request to see if the expected parameters are present. If it
> only checks the body of the request (which is where form control names and
> values are placed), then you can't fake the form with URL parameters.


So what you're saying is that it all depends on the kind of script, some use
the url and others don't ?
Ok, that makes sense.

 
Reply With Quote
 
bauhaus
Guest
Posts: n/a
 
      03-26-2009
> Because the method is POST, not GET.

Thats whats confusing me.
I have another similar example:

<form name="top" action="?m=gen" method="POST">
<input type="submit" value="Get NZB" name="getnzb">
<input type="hidden" name="p" value="244416">
<input type="hidden" name="mode" value="usenet">
<input type="hidden" name="offset" value="0">
<input type="hidden" name="type" value="">
<input type="hidden" name="group" value="">
<input type="hidden" name="q" value="">
<input type="hidden" name="age" value="200">
<input type="hidden" name="get" value="0">
</form>

Now, when I try this:
http://www.newzleech.com/?m=gen&getn...ffset=0&binary[]=1001917

It DOES download the file....

So whats the difference between this example and the previous one ?

 
Reply With Quote
 
bauhaus
Guest
Posts: n/a
 
      03-26-2009
> This will work provided the user isn't one of those paranoid types that
> turn off JavaScript...
>
> <html>
> <head>
>
> <script language="JavaScript" type="text/JavaScript">
> <!-- AUTO-SUBMIT FORM
> function submit_form(){
> document.myform.submit();
> }
> // - End of JavaScript - -->
> </script>
>
> </head>
> <body onload="submit_form();">
>
> <form name="myform" method="post"
> action="http://binsearch.info/fcgi/nzb.fcgi">
> <input name="action" value="nzb">
> <input value="NZB" type="submit">
> </form>
>
> </body>
> </html>


Thanks Andy, works like a charm !

 
Reply With Quote
 
rf
Guest
Posts: n/a
 
      03-26-2009
bauhaus wrote:
>> Because the method is POST, not GET.

>
> Thats whats confusing me.
> I have another similar example:
>
> <form name="top" action="?m=gen" method="POST">
> <input type="submit" value="Get NZB" name="getnzb">
> <input type="hidden" name="p" value="244416">
> <input type="hidden" name="mode" value="usenet">
> <input type="hidden" name="offset" value="0">
> <input type="hidden" name="type" value="">
> <input type="hidden" name="group" value="">
> <input type="hidden" name="q" value="">
> <input type="hidden" name="age" value="200">
> <input type="hidden" name="get" value="0">
> </form>
>
> Now, when I try this:
> http://www.newzleech.com/?m=gen&getn...ffset=0&binary[]=1001917
>
> It DOES download the file....
>
> So whats the difference between this example and the previous one ?


You snipped the most important bit from Lars's post:

>>You really need to get a basic understanding of the difference between
>>GET and POST. You cannot fake POST in the url.


There is get and there is post. It is up to the server side process to look
for post of get or either. Some do both. Some do get. Some do post.

Your first example obvously contacted a server side process that only
accepted post.

You current example obvously contacted a server side process that accepted
either.

A server side process that looks for get will parse the URL it is given to
obtain the get parameters (the bit following the ? in the URL);

A server side process that looks for post will delve into the request
headers to obtain the post parameters.


 
Reply With Quote
 
rf
Guest
Posts: n/a
 
      03-26-2009
Andy wrote:
> "Harlan Messinger" <(E-Mail Removed)> wrote in
> message news:(E-Mail Removed)...
>> bauhaus wrote:
>>> I have a html page containing this form:
>>>
>>> <form method="post" action="http://binsearch.info/fcgi/nzb.fcgi">
>>> <input name="action" value="nzb">
>>> <input value="NZB" type="submit">
>>> </form>
>>>
>>> When I load the html page in my browser and press the submit
>>> button, it downloads a nzb file.
>>>
>>> But how can I execute it directly from the url without pressing the
>>> submit button, what are the parameters ?
>>>
>>> I tried this: http://binsearch.info/fcgi/nzb.fcgi?action=nzb but
>>> then I get the error: no parameters.
>>>
>>> Any suggestions ?

>>
>> For that to work, the program nzb.fcgi has to check both the URL and
>> the body of the request to see if the expected parameters are
>> present. If it only checks the body of the request (which is where
>> form control names and values are placed), then you can't fake the
>> form with URL parameters.

>
>
> This will work provided the user isn't one of those paranoid types
> that turn off JavaScript...


This issue has nothing at all to do with JavaScript.


 
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
how to convert url with query string to url without query string nick Javascript 1 02-13-2011 11:20 PM
Query parameters, Javascript and URL decoding issue R L Vandaveer ASP .Net 0 12-22-2005 04:48 PM
getting values from URL such as http://groups.google.co.uk/groups?q=parameters+url+asp.net&start=10&hl=en&lr=& anonymous ASP .Net 1 05-08-2005 03:58 PM
url rewriting when the url contains parameters Gaurav Agarwal Java 2 01-31-2005 11:15 AM
redirect URL's, return URL's, and URL Parameters Jon paugh ASP .Net 1 07-10-2004 05:29 AM



Advertisments