[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Net::HTTP.post_form issue

Coosa Aa

3/8/2007 6:41:00 PM

Dear all,

I'm a newbie and have been looking for a solution regarding the
following issue:
I'm trying to get the results from the page
http://daftarj.s...da... and looking at the source of
the
page I have the following information:

<form method="post" name="def" action="daftarbi.asp">
.
.
.
<INPUT name="txtIC" maxlength="12"><Input type=hidden name="txtSub">
<INPUT type="button" name="Check" value="Check" onclick="submitted()">
.
.
</form>
There is no query string such as ...asp?id=blabla&something=blabla, so
I
need to simply pass the value I wish to post such as "0000059" into
that
hidden field and get the results bypassing the click on the button!
Is this possible? I have tried a simple code and What didn't work is
that it's not displaying the results based on the
query as if it didn't submit the id for the hidden field in the input
form!:

require 'net/http'
require 'uri'
res = Net::HTTP.post_form URI.parse('http://daftarj.s...
daftarbi.asp'),{"txtSub" => "0000059"}
case res
when Net::HTTPSuccess, Net::HTTPRedirection
puts res.body
else
res.error!
end

Kindly correct me If I'm wrong

Appreciate any help

regards

1 Answer

Coosa Aa

3/8/2007 9:03:00 PM

0

On Mar 9, 2:41 am, "coosa" <coos...@gmail.com> wrote:
> Dear all,
>
> I'm a newbie and have been looking for a solution regarding the
> following issue:
> I'm trying to get the results from the pagehttp://daftarj.s...dafta... looking at the source of
> the
> page I have the following information:
>
> <form method="post" name="def" action="daftarbi.asp">
> .
> .
> .
> <INPUT name="txtIC" maxlength="12"><Input type=hidden name="txtSub">
> <INPUT type="button" name="Check" value="Check" onclick="submitted()">
> .
> .
> </form>
> There is no query string such as ...asp?id=blabla&something=blabla, so
> I
> need to simply pass the value I wish to post such as "0000059" into
> that
> hidden field and get the results bypassing the click on the button!
> Is this possible? I have tried a simple code and What didn't work is
> that it's not displaying the results based on the
> query as if it didn't submit the id for the hidden field in the input
> form!:
>
> require 'net/http'
> require 'uri'
> res = Net::HTTP.post_form URI.parse('http://daftarj.s...
> daftarbi.asp'),{"txtSub" => "0000059"}
[snippet]
I have also tried on "txtIC" instead of "txtSub" and both don't
display the resulst; is it perhaps because the POST called the
javascript function "Submitted()"?
[/snippet]
> case res
> when Net::HTTPSuccess, Net::HTTPRedirection
> puts res.body
> else
> res.error!
> end
>
> Kindly correct me If I'm wrong
>
> Appreciate any help
>
> regards