I want to create a PHP script that automatically logs in to a site and then automatically changes the e-mail address for that account. I found a "Silent POST" curl script (attached) that works for the first part and I am able to log in successfully. But how do I change the e-mail variable once logged in?
To log-in, I do the first "Silent POST" (attached). But how do I do a second "Silent POST" to change the e-mail of the account once the server script is logged-in (the form name of the e-mail field once logged in is "newemail" so the CURLOPT_POSTFIELDS variable would simply be "newemail=$newemail")?
I have tried repeating the same code attached (with the new variables) after the login code and it did not work even though it logs-in successfully.
Any help would be appreciated. Please provide the exact working code if possible.
$curl = curl_init();
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, "username=$username&password=$password");