Good day, I need to make CURL get a hash code from a page, and then use it to perform a POST action, while both of them being in one session (seperate sessions will not work because of the hash mismatch). In the following code, CURL pushes the page into $res variable, then the explosion part follows and the final hash code is stored in $hash2, now I need to perform a POST action using $hash2 within the very same CURL session. $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://www.annaabi.com/'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $res = curl_exec($ch); curl_exec($ch); $hash1 = explode('<input type="hidden" value="',$res); $hash2 = substr($hash1[1],0,32); echo $hash2; PHP:
I actually got it figured out, sample code @ http://www.php.net/manual/en/function.curl-setopt.php#85956