By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,051 Members | 1,258 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,051 IT Pros & Developers. It's quick & easy.

how to post the values to the form whose action is in javascript?

P: n/a
Hi

I am trying to post the values to the form. The form action is not
done in html i.e not in form tag, it is done by javascript code using
document.FORMNAME.action = "results.asp";

I think in that results.asp file, they are creating one xml file for
the posted values and these xml file has been redirected to some other
asp file. for ex, displayresults.asp to show the results.

My actual flow is...

I am searching some "example" content in http://example.com/
example.asp and i am getting answers for the searched "example" in
http://example.com/displayresults.asp. Before getting the answer in
the page, i can see http://example.com/example.asp redirecting to
http://example.com/results.asp and then finally getting answer in
http://example.com/displayresults.asp.

I tried to achieve/get the content by posting the values through CURL,
but i didnt get the content. When i echoed the content i can see that
my posted values has been passed/set perfectly. I have doubt on
javascript action....not sure only because of this action.
Code:

curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch,CURLOPT_POSTFIELDS,$postvalues);
curl_setopt($ch,CURLOPT_COOKIEJAR,$fpath.'/example.txt');
curl_setopt($ch,CURLOPT_FOLLOWLOCATION,0);
curl_setopt($ch, CURLOPT_HEADER , 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

I dont know whether i have to set the redirection param or something
else.

Can anyone please teach me how to proceed with this?

Jan 29 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Got the solution.

Feb 2 '07 #2

P: n/a
On 2 Feb, 10:39, "Mani" <maniraj...@gmail.comwrote:
Got the solution.
Care to share it?

Feb 2 '07 #3

P: n/a
On Feb 2, 3:42 pm, "Captain Paralytic" <paul_laut...@yahoo.comwrote:
On 2 Feb, 10:39, "Mani" <maniraj...@gmail.comwrote:
Got the solution.

Care to share it?
In the beginning, I was trying http://example.com/ as URL to get the
content. But i didnt get the content. After that, I picked the form
action value and necessary varible values [which will be passed to the
form action ] from the http://example.com/ source [ Javascript
section ].

Then, I used http://example.com/ACTIONVALUE as url with necessary
javascript variables as post values for the CURL operation and got the
expected content sucessfully.

Feb 15 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.