Wordpress Admin Panel Login Script
This script will help you to log in into your wordpress admin panel. You need to create a file cookie.txt and make it writable. You can add more functionality and do wonders..Happy coding
<?php
$url="http://yoursite.com/wordpress/"; //Full path to your wordpress site
$user='Your username';
$password='Your Password';
$cookie="cookie.txt";
/**********************No Need To Edit Below ***************************************************/
$postdata = "log=".$user."&pwd=". $password ."&wp-submit=Log%20In&redirect_to=". $url ."wp-admin/&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);
echo $result;
echo "</br> <a href='http://samplephpcodes.com'>Sample PHP Codes</a>";
?>
Home
See the related postsPHP Warning: Call-time pass-by-reference has been deprecated Working with Database (MySQL) Cookies in PHP Session Management Functions in php Join array elements with a string – implode |




