473,804 Members | 3,191 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

curl javascript form completion

Hello, can someone please tell me the correct way to use "curl" to complete
an online form? I am trying to eventually retrieve my account balance via
a cron job that will email me the parsed output of the web page that gets
returned from the curl form completion.

The page I am trying to access is https://retire.hartfordlife.com/index.html
and the html block that contains the form is:

<form method="post" name="form1"
action="https://retire.hartford life.com/HartfordOnline/Login"><input
type="hidden" name="target" value="MultiRol e" /> <table width="100%"
border="0" cellspacing="0" cellpadding="2" bgcolor="#e2e9f 1">
<tr>
<td colspan="2"><fo nt color="#000000" face="Verdana, Arial, Helvetica,
sans-serif" size="3"><stron g><font size="2">Hartfo rd<em>Online</em>
Login</font></strong></font></td>
</tr>
<tr>
<td nowrap><font face="Verdana, Arial, Helvetica, sans-serif"
size="2">User
ID</font></td> <td><input type="text" size="18" name="user" tabindex="1"
value=""/></td>
</tr>
<tr>
<td><font face="Verdana, Arial, Helvetica, sans-serif"
size="2">PIN</font></td> <td><input type="password" size="18"
tabindex="2"
name="password" value=""/></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="2"
bgcolor="#e2e9f 1">
<tr>
<td nowrap><a tabindex="4"
href="https://retire.hartford life.com/HartfordOnline/ChallengePhrase "><fonts
ize="1" face="Verdana, Arial, Helvetica, sans-serif">Forgot Your
PIN?</font></a><font size="1" face="Verdana, Arial, Helvetica,
sans-serif"><br /><a tabindex="5"

href="HartfordO nline">https://retire.hartford life.com/Enrollment/Enroll">Har
tfordOnline
Enroll</a></font></td> <td><a tabindex="3"
href="javascrip t:document.form s['form1'].submit()"><img src="imgs/lock.gif"
width="13" height="16" border="0" title="ssl"><im g src="imgs/login.gif"
width="39" height="16" border="0" /></a>
</td>
</tr>
</table>
</form>

I don't know how to handle the
_href="javascri pt:document.for ms['form1'].submit()"_ but what is failing to
return the desired page is this command:

/usr/bin/curl -A "Mozilla/4.0" -F user=myuser -F password=mypass wd \
-F form1="https://retire.hartford life.com/HartfordOnline/Login" \
-F target="MultiRo le" https://retire.hartfordlife.com/index.html \
results.html


I would really, really appreciate any help that anyone can offer about the
correct curl command to use to complete this form.

Apr 6 '06 #1
1 13264
On 2006-04-06, ynotssor <yn******@examp le.net> wrote:
Hello, can someone please tell me the correct way to use "curl" to complete
an online form? I am trying to eventually retrieve my account balance via
a cron job that will email me the parsed output of the web page that gets
returned from the curl form completion.

The page I am trying to access is https://retire.hartfordlife.com/index.html
and the html block that contains the form is:
[...]
I don't know how to handle the
_href="javascri pt:document.for ms['form1'].submit()"_ but what is failing to
return the desired page is this command:
I don't think the fact that the form is submitted with a JavaScript call
to the DOM rather than by the browser's builtin way of handling an HTML
"submit" button makes any difference, fortunately. What the server gets
sent is the same, and that's the point at which curl steps in.
/usr/bin/curl -A "Mozilla/4.0" -F user=myuser -F password=mypass wd \
-F form1="https://retire.hartford life.com/HartfordOnline/Login" \
-F target="MultiRo le" https://retire.hartfordlife.com/index.html \
> results.html


I would really, really appreciate any help that anyone can offer about the
correct curl command to use to complete this form.


I think I got most of the way there with this:

curl -A "Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.7.12) Gecko/20050920 Firefox/1.0.7" \
-d "target=MultiRo le&user=bla&pas sword=bla" \
https://retire.hartfordlife.com/HartfordOnline/Login > results.html

Try it with your real username and password (where I've put "bla"). Your
abbreviated user agent string may well be fine, but to be on the safe
side I used exactly the same thing Firefox was using.

You probably also will need to add the options "-a ./cookies -b
../cookies" because you may need cookies when it comes to actually
interacting with the site properly.

I think you want -d for the postdata, not -F. -F is for
multipart/form-data data which is a different data format (usually used
for file uploads). This form is just an urlencoded one, for which you
use -d.

A really good way of figuring these out is to use Firefox's "Tamper
Data" extension, which lets you see exactly what it submitted to the
server and exactly what came back.
Apr 12 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3357
by: D Benfer | last post by:
Hi all, Im a bit thrown by curl. I want to submit some order data on an ecommerce site via a form to a php page, where the data is saved to a database. Then I want to use curl to submit the form data I just saved (and redirect the user) to my secure credit card gateway. Problem is, they have their own secure payment screen where the credit card information is entered. I can't just retrieve the variable with a transaction...
9
8769
by: Dave Martin | last post by:
I've successfully used CURL to maneuver around and through sites but a new site I've been trying to work with has got me stumped. To retrieve the data I'm trying to get a login is required. If you go to any page in the "member" area without logging in you get directed to a https connection and hit login.php (ie: you end up at https://www.domain.com/login.php). The problem, I believe, lies in the fact that the form on that page...
9
12599
by: Conrad F | last post by:
Hi, If any Microsoft people are listening.... Are there any plans for the new web language called "Curl" to be supported in .NET (ASP.NET)? I ask as Curl represents the first step to true OO programming of web pages and not just running "scripts" which have in-roads into service DLLs of other languages such as C#. Surely MS will put Curl into .NET at some time since it is designed to work with DirectX and OpenGL?
6
4269
by: Wescotte | last post by:
I'm writing a tiny php app that will log into our bank of america account and retrieve a file containing a list of checks that cleared the previous day. The problem I'm running into is when I perform actions with php/CURL the output is different than when I use IE and I'm completely stumped as to why. The final output should list files available for retrieval but the CURL output displays an error/empty file message. Here is the curl...
0
1521
by: existatus | last post by:
In a form there are entries like this: <input type="text" name="first_name" size="24" /> <input type="text" name="last_name" size="24" /> <input type="hidden" name="must_have" value="12345" /> <input type="hidden" name="recipient" value="myemail@comcast.net" /> <input type="hidden" name="redirect" value="http://mywebsite.com" /> <input type="hidden" name="subject" value="Topic In Question" />
1
4910
by: c1pkw | last post by:
Hi there, I’m having a real heap of trouble with PHP and cURL My aim is to use this code (or something like it) to submit 2 fields to a remote server (using GET) and receive back 6 fields (again with GET). When I run the function below, I get back a 401 unauthorized error although the Username and Password are correct. Presumably then, they are not reaching the remote server at all or in the correct state. Problem is, I know so...
3
4214
by: adamalton | last post by:
Hi, I am using cURL with php to submit a form to a website and then retrieve the page that comes back. That part is easy. The problem is that the site I am posting the request to displays a 'please_wait' page which then redirects you to the page that you actually want to see. I can deal with this fine if I am only sending one request, but the trouble is that I am sending lots of requests (i.e. I am posting the form several times with...
1
1600
by: Teamwolf | last post by:
Hi, I am currently finishing integration with a third party payment gateway and my own bespoke shopping cart. Currently:- My checkout process page adds all the order and customer data to my database tables. There is an HTML form in the HTML of that page that is submitted by JavaScript onload that posts the required data I have already collected to the Payment Gateway. On successful payment, the Order in the database is flagged as paid....
7
5077
by: h.stroph | last post by:
Greetings, I apologize for my lack of literacy with php, but am wondering if someone will tell me how to use the curl php functions to navigate to the page that results from entering the login and password at https://retire.hartfordlife.com/HartfordOnline/login.html and clicking the "Log In" button please. My intention is to cron the script so that I can automatically retrieve my account balance every morning, but the javascript is...
0
9585
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10586
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10082
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7622
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6856
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5658
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3823
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2997
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.