Post_form

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.spr.gov.my/daftarbi.asp and looking at the source of the
page I have the following information:

. . . . . 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? Is this possible? I have tried a simple code and it didn't work:

require ‘net/http’
require ‘uri’
res = Net::HTTP.post_form
URI.parse(‘http://daftarj.spr.gov.my/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

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!

Coosa Aa wrote:

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!

It’s not displaying the results; there is a button in the page and when
clicked, a JavaScript function “submitted()” is called. Now the response
is OK, but I get no results as expected; I appreciate you try going to
the link I provided.
Simply I don’t know how to call the Javascript function within my Ruby
code.

regards

Coosa Aa wrote:

Coosa Aa wrote:

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!

It’s not displaying the results; there is a button in the page and when
clicked, a JavaScript function “submitted()” is called. Now the response
is OK, but I get no results as expected; I appreciate you try going to
the link I provided.
Simply I don’t know how to call the Javascript function within my Ruby
code.

regards

Inside the form (Though it would be helpful):

I called once in my Ruby Code:
URI.parse(‘http://daftarj.spr.gov.my/daftarbi.asp’),{“txtSub” =>
“0000059”}
and once:
URI.parse(‘http://daftarj.spr.gov.my/daftarbi.asp’),{“txtIC” =>
“0000059”}
but it never showed the results either way.

On 3/8/07, Austin Z. [email protected] wrote:

You probably want to ask this on the Rails forum. This is the general
Ruby mailing list, mirrored to ruby-forum.com.

I was wrong. This is the right place; I just don’t know the answer and
I shouldn’t post when I’m too busy to read in detail. Sorry, Coosa.

-austin

On 3/8/07, Coosa Aa [email protected] wrote:

Coosa Aa wrote:

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!
It’s not displaying the results; there is a button in the page and when
clicked, a JavaScript function “submitted()” is called. Now the response
is OK, but I get no results as expected; I appreciate you try going to
the link I provided.
Simply I don’t know how to call the Javascript function within my Ruby
code.

You probably want to ask this on the Rails forum. This is the general
Ruby mailing list, mirrored to ruby-forum.com.

-austin

Coosa Aa schrieb:

(…) I appreciate you try going to the link I provided.

The page says “ELECTION COMISSION OF MALAYSIA, ELECTORS ROLL CHECKING”.
Can you tell me what this page is about and what you are trying to do?

Regards,
Pit

Pit C. wrote:

Coosa Aa schrieb:

(…) I appreciate you try going to the link I provided.

The page says “ELECTION COMISSION OF MALAYSIA, ELECTORS ROLL CHECKING”.
Can you tell me what this page is about and what you are trying to do?

Regards,
Pit
The problem is solved by modifing the line into:
URI.parse(‘http://daftarj.spr.gov.my/daftarbi.asp’),{“txtIC” =>
“0000059”, “txtSub” => “Submitted”}
The JavaScript function already cleared but I overlooked it!
But for your comment, watch what you write and don’t judge and forget
that the page is publically accessible; so I don’t post here to get such
comments and I that question of yours doesn’t deserve a response!

Regards

Coosa Aa schrieb:

Pit C. wrote:

The page says “ELECTION COMISSION OF MALAYSIA, ELECTORS ROLL CHECKING”.
Can you tell me what this page is about and what you are trying to do?

But for your comment, watch what you write and don’t judge and forget
that the page is publically accessible; so I don’t post here to get such
comments and I that question of yours doesn’t deserve a response!

Hi Coosa Aa. Yes, it’s a public site. But when I entered the data you’ve
mentioned, the response looked like personal data to me. Since I don’t
know the language spoken in Malaysia, I wasn’t sure about that. That’s
why I asked you my question. Now, interpreting your answer, I think I
was right that it’s possible to get at personal data by entering the
right numbers. If this is not what you’re after, I apologize. It seems
you found at least one part of the answer to your question, so I guess I
don’t have to show you my solution.

Regards,
Pit

Austin Z. wrote:

On 3/8/07, Coosa Aa [email protected] wrote:

Coosa Aa wrote:

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!
It’s not displaying the results; there is a button in the page and when
clicked, a JavaScript function “submitted()” is called. Now the response
is OK, but I get no results as expected; I appreciate you try going to
the link I provided.
Simply I don’t know how to call the Javascript function within my Ruby
code.

You probably want to ask this on the Rails forum. This is the general
Ruby mailing list, mirrored to ruby-forum.com.

-austin

I’m not using Rails at all,
The Net::HTTP.post_form is a core Ruby library and i’m just using a
simple Ruby code in a *.rb file

Pit C. wrote:

Coosa Aa schrieb:

Pit C. wrote:

The page says “ELECTION COMISSION OF MALAYSIA, ELECTORS ROLL CHECKING”.
Can you tell me what this page is about and what you are trying to do?

But for your comment, watch what you write and don’t judge and forget
that the page is publically accessible; so I don’t post here to get such
comments and I that question of yours doesn’t deserve a response!

Hi Coosa Aa. Yes, it’s a public site. But when I entered the data you’ve
mentioned, the response looked like personal data to me. Since I don’t
know the language spoken in Malaysia, I wasn’t sure about that. That’s
why I asked you my question. Now, interpreting your answer, I think I
was right that it’s possible to get at personal data by entering the
right numbers. If this is not what you’re after, I apologize. It seems
you found at least one part of the answer to your question, so I guess I
don’t have to show you my solution.

Regards,
Pit

Such childish plays; we’re here in a professional forum, so be one. I
even mentioned that I solved it, so don’t even try to impress by
mentioning that you have an answer; I don’t need it, I have it -
“txtSub” => “Submitted”.

Coosa Aa wrote:

Pit C. wrote:

Coosa Aa schrieb:

Pit C. wrote:

The page says “ELECTION COMISSION OF MALAYSIA, ELECTORS ROLL CHECKING”.
Can you tell me what this page is about and what you are trying to do?

But for your comment, watch what you write and don’t judge and forget
that the page is publically accessible; so I don’t post here to get such
comments and I that question of yours doesn’t deserve a response!

Hi Coosa Aa. Yes, it’s a public site. But when I entered the data you’ve
mentioned, the response looked like personal data to me. Since I don’t
know the language spoken in Malaysia, I wasn’t sure about that. That’s
why I asked you my question. Now, interpreting your answer, I think I
was right that it’s possible to get at personal data by entering the
right numbers. If this is not what you’re after, I apologize. It seems
you found at least one part of the answer to your question, so I guess I
don’t have to show you my solution.

Regards,
Pit

Such childish plays; we’re here in a professional forum, so be one. I
even mentioned that I solved it, so don’t even try to impress by
mentioning that you have an answer; I don’t need it, I have it -
“txtSub” => “Submitted”.

[Solved] A kind request for the admins to close the post.
Clearance: the question relates to a part of my “Final Year Project” in
the Multimedia University http://www.mmu.edu.my of the Faculty of IT, to
create an online e-voting system in Malaysia; silly childish questions
attempting to lecture me about morals are useless; any naive person
would obviously see that the page I provided has a “gov” domain and It’s
annoying assuming I don’t know that! If I’m stupid enough to attempt to
do some thing wrong, I would have obviously written a sample of a normal
page which uses the same pattern; It’s the first time in a forum I see
such annoying people like “Pit”.
No more replies to this post would be posted from my side.

Regards