how are you?
i have a non expected result ,
it should return "1" when login successfuly , and "0" when login error,
and it always return "0"
<?php
$username = 'admin';
$password = 'admin';
$loginUrl = 'http://localhost/wordpress/wp-login.php';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $loginUrl);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'log='.$username.'&pwd='.$password);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$store = curl_exec($ch);
curl_setopt($ch, CURLOPT_URL, 'http://localhost/wordpress/wp-admin/index.php');
$content = curl_exec($ch);
curl_close($ch);
file_put_contents('3.php', $content);
// if "Password" appear then login error;
echo preg_match("/Password/",file_get_contents("3.php"));
?>
and Thank you :)