GET image after POST
Date: Fri, 01 Aug 2008 10:05:42 -0400
I'm currently trying to write a program in C utilizing libcurl.
I'm using the Tamper Data and LiveHTTPheaders add-ons in firefox to see
the HTTP headers being traded between my computer and a server. There is
an initial GET to retrieve the cookies and PHPSESSID.
Next I POST with the desired form values which I retrieve from user
input. Right after this POST I need to GET an image/gif file. The img
src is located in the POST form and I don't know how to retrieve it and
issue a GET at that URL. Firefox does this sequence automatically but I
don't know how to program. Regexp and string searching is horrible in C
so I'm trying to avoid that.
Here's a breakdown of what I have so far:
Issue a GET @ URL: get cookies
Issue a POST: send needed form values
(Firefox issues a GET here at the URL within the next POST form, this is
what I need)
This is what the POST form looks like:
<form method=post action="http://siteaddress.com/web_message"
name="challengeForm" onsubmit="return validate(this);">
<table style="margin-left: 75px;" border=1 cellpadding=0 cellspacing=0
height=55 width=300 bgcolor=#CCCCCC
<td><img height=55 width=300
<p class=body style="margin-top:10px">
<table><tr valign=center><td valign=center class=body-bold>Enter Code
<td valign=center><input autocomplete="off" type=text name=chresp></td>
<td valign=center><input type=image
type=hidden name=fkey value="~1217596520.8727.1422187.0"><input
type=hidden name=ServiceID value="0119"></td>
How does firefox automatically issue a GET for
I tried using CURLOPT_FOLLOWLOCATION with no success. I just need the
value of fkey from the above and then issue a GET at URL
That's my logic so far.
Received on 2008-08-01