cURL / Mailing Lists / curl-users / Single Mail

curl-users

Difficulty Posting <form> C/C++

From: unleadedblues <unleadedblues_at_gmail.com>
Date: Thu, 24 Sep 2009 03:10:00 -0400

I am trying to browse through a Web Proxy and while my code works very well through some proxies it fails on many others.

One particluar Web Proxy where it fails is: http://www.firewallfilter.com/
Immediately below is the <form> from firewallfilter.com which I am trying to successfully post and below that is the code I am unsuccessfully using.

Any suggestions regarding what I might be doing wrong would be greatly appreciated.

Thank you,
Curt

========================================================
<form action="includes/process.php?action=update" method="post" class="minime_url_form">
<fieldset>
        <label for="minime_url_textbox" id="minime_url_label">Address: </label>
        <div id="minime_url_textbox_back">
        <input type="text" name="u" id="minime_url_textbox" />
        </div>
        <input type="submit" value="Open!" id="minime_submit" />

        <input type="button" id="options_switch" value="Options" onclick="optionsFx.toggle();" />
        <a href="http://forum007.com" target="_blank" style="color: rgb(255, 153, 0);">Join <strong>proxy forum!</strong></a>
        <br>
<script type="text/javascript"><!--
google_ad_client = "pub-2386343051480450";
/* 468x15, proxoin */
google_ad_slot = "8716255178";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</fieldset>
</form>
========================================================
void Test::Run(void)
{
        CURLcode res;

        curl_global_init(CURL_GLOBAL_ALL);

        CURL * curl = curl_easy_init();

            if(!curl) {
                    return;
            }
        curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "u=http://www.msn.com&submit=open!");
            curl_easy_setopt(curl, CURLOPT_URL, "http://firewallfilter.com/includes/process.php?action=update");

            curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);

            curl_easy_setopt(curl, CURLOPT_REFERER, "http://firewallfilter.com");
            curl_easy_setopt(curl, CURLOPT_USERAGENT, "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.14) Gecko/2009090217 Ubuntu/9.04 (jaunty) Firefox/3.0.14");

          res = curl_easy_perform(curl);

           /* always cleanup */
           curl_easy_cleanup(curl);

          return;
}

-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-09-24