How to make this works? automated poll

Jeo James <[email protected]> Mon, 22 Aug 2011 10:19:28 +0900
Newsgroups gmane.comp.web.curl.php
Message-ID <CAM3X-39LFJWE3SpZyxyqkHryR0wSCDEA4x3UBWpvMBe-p3QC5A@mail.gmail.com>
hi everyone, I have a problem regarding this one, the cURL function is not
working.
I am testing that the option D to be automatically selected to be submitted
when the site loaded.

I attached my files..
Thank you

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
sample.html (text/html, 3 KB)
<html>
<head>
<title>Sample</title>
</head>
<body>
<script type="text/javascript">
var cookie_booroo=0, random_booroo=0, enddate_booroo=0, maxchecked_booroo=0, jsonurl_booroo='http://booroo.com/app/vote.asp', customurl_booroo='';</script>

<link rel="stylesheet" type="text/css" media="screen" href="http://booroo.com/app_content/theme_poll/2/set3/css/default.css" /> <!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" media="screen" href="http://booroo.com/app_content/theme_poll/2/set3/css/ie.css" /><![endif]-->
<div class="poll_booroo cleanslate" style="width:300px;"><!-- change poll width here -->
<div class="theme_booroo"><p>test</p><div class="content_booroo"><div class="options_booroo"><form class="form_booroo">

<fieldset>
<div class="padded_booroo">
<input name="qid" value="14324" type="hidden"><input name="sid" value="fjhmfxeyhswh5bw14324" type="hidden">
<input name="pqid" value="8908" type="hidden">
<div class="items_booroo">
<div class="row_booroo"><label><input type="radio" name="ans" value="41458" id="ans-41458" class="checkbox_booroo" />A</label></div>
<div class="row_booroo"><label><input type="radio" name="ans" value="41459" id="ans-41459" class="checkbox_booroo" />B</label></div>
<div class="row_booroo"><label><input type="radio" name="ans" value="41460" id="ans-41460" class="checkbox_booroo" />C</label></div>
<div class="row_booroo"><label><input type="radio" name="ans" value="41461" id="ans-41461" class="checkbox_booroo" checked />D</label></div>

</div>
<div class="submit_booroo"><a class="viewresults">View results</a><a class="vote_booroo">Vote Now</a></div></div>
<p><a href="http://booroo.com">Create an online survey</a> <a href="http://booroo.com/quizzes">quiz</a> or <a href="http://booroo.com/polls">web poll</a></p></fieldset></form></div><div class="results_booroo">
<div class="padded_booroo">
<div class="row_booroo"><strong>A</strong><img src="http://booroo.com/app_content/theme_poll/2/set3/images/graph.gif" id="res-41458" class="result_booroo" style="width:0%;" /><span>0%</span></div>
<div class="row_booroo"><strong>B</strong><img src="http://booroo.com/app_content/theme_poll/2/set3/images/graph.gif" id="res-41459" class="result_booroo" style="width:0%;" /><span>0%</span></div>
<div class="row_booroo"><strong>C</strong><img src="http://booroo.com/app_content/theme_poll/2/set3/images/graph.gif" id="res-41460" class="result_booroo" style="width:0%;" /><span>0%</span></div>
<div class="row_booroo"><strong>D</strong><img src="http://booroo.com/app_content/theme_poll/2/set3/images/graph.gif" id="res-41461" class="result_booroo" style="width:0%;" /><span>0%</span></div>
</div>
<p><a href="http://booroo.com">Create an online survey</a> <a href="http://booroo.com/quizzes">quiz</a> or <a href="http://booroo.com/polls">web poll</a></p></div></div></div></div><!--Requires jquery 1.6.1 --><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"></script><script src="http://booroo.com/app/polltheme/2/poll.js" type="text/javascript"></script>

</body>
</html>
test.php (application/x-httpd-php, 585 B)
    <?
        $url = 'url.com/sample.html';
      // curl_setopt($ch, CURLOPT_URL, 'url.com/sample.html' );

       $post_str = urlencode("qid=14324&sid=fjhmfxeyhswh5bw14324&pqid=8908&ans=41461");
       $ch = curl_init();
       curl_setopt($ch, CURLOPT_POST,1);
       curl_setopt($ch, CURLOPT_POSTFIELDS,$post_str);
       curl_setopt($ch, CURLOPT_URL,$url);
    //  curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
       curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);

       $result=curl_exec ($ch);
       curl_close ($ch);

       echo "Results: <br>".$result;