title: automatic login to wordpress dashboard from another site
body: <p>I want to log in automatically to WP admin/dashboard from another site without going thru the login process.. I've tried the following but with no luck:</p>
  
  <pre><code>&lt;?php
  
  $username="admin";
  $password="mypasw";
  $url="http://example.com/";
  $cookie="cookie.txt";
  
  $postdata = "log=". $username ."&amp;pwd=". $password ."&amp;wp-submit=Log%20In&amp;redirect_to=". $url ."wp-admin/&amp;testcookie=1";
  $ch = curl_init();
  curl_setopt ($ch, CURLOPT_URL, $url . "wp-login.php");
  curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
  curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
  curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
  curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookie);
  curl_setopt ($ch, CURLOPT_REFERER, $url . "wp-admin/");
  curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);
  curl_setopt ($ch, CURLOPT_POST, 1);
  $result = curl_exec ($ch);
  curl_close($ch);
  echo $result;
  exit;
  
  
  ?&gt;
  </code></pre>
  
  <p>It's kind of like only showing me the dashboard page but I'm not really logged in since clicking on any buttons on the admin page is only redirecting to same page which is the site page.. :(</p>