title: Using libcurl on visual c++ to login to a website，How to check login success?
body: <p>I use the demo to login a website "<a href="http://www.hackthissite.org/user/login/" rel="nofollow">http://www.hackthissite.org/user/login/</a>".
  and the return value from console is many html information. just like:</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;
  
  &lt;head&gt;
  &lt;title&gt;Hack This Site! :: Login&lt;/title&gt;
  &lt;meta name="verify-v1" content="s/YXn7eQrMBoF9PL5jLJDiWpAxEXpJzE9JLg/zM4C2Y=" /&gt;
  Freenode for general discussion or any questions you h...&lt;/div&gt;
  ............
  &lt;br /&gt;
  &lt;br /&gt;
  &lt;span style="font-size: 10px;"&gt;&lt;a href="/news/view/690"&gt;read more...&lt;/a&gt; | &lt;a 
  &lt;/body&gt; 
  &lt;/html&gt; 
  </code></pre>
  
  <p>But I don't know Is it on behalf of login success?
  MY demo code is:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  #include &lt;curl/curl.h&gt;
  #include &lt;curl/types.h&gt;
  #include &lt;curl/easy.h&gt;
  
  
  int main()
  {
  
  curl_global_init( CURL_GLOBAL_ALL );
  CURL * myHandle = curl_easy_init ( );
  
  // Set up a couple initial paramaters that we will not need to mofiy later.
  curl_easy_setopt(myHandle, CURLOPT_USERAGENT, "Mozilla/4.0");
  curl_easy_setopt(myHandle, CURLOPT_AUTOREFERER, 1 );
  curl_easy_setopt(myHandle, CURLOPT_FOLLOWLOCATION, 1 );
  curl_easy_setopt(myHandle, CURLOPT_COOKIEFILE, "");
  
  // Visit the login page once to obtain a PHPSESSID cookie
  curl_easy_setopt(myHandle, CURLOPT_URL, "http://www.hackthissite.org/user/login/");
  curl_easy_perform( myHandle );
  
  
  // Now, can actually login. First we forge the HTTP referer field, or HTS will deny the login
  curl_easy_setopt(myHandle, CURLOPT_REFERER, "http://www.hackthissite.org/user/login/");
  // Next we tell LibCurl what HTTP POST data to submit
  char *data="username=your_username_here&amp;password=your_password_here";
  curl_easy_setopt(myHandle, CURLOPT_POSTFIELDS, data);
  curl_easy_perform( myHandle );
  
  curl_easy_cleanup( myHandle );
  
  
  return 0;
  }
  </code></pre>
  
  <p>Please help me , thank you very much!</p>