Nerde hata yapıyorum sizce?
basitçe kodlar:
curl_setopt($ch,CURLOPT_URL, "http://www.siteadi.com/submit.php");
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12 GTB7.1");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$goster = curl_exec($ch);
//Save The Values
$dosya = "kaynak.txt";
$conn = fopen($dosya , 'w+' ) or die ("dosya açılamadı" );
fwrite($conn, $goster );
fclose($conn );
$datarandkey = file_get_contents($goster);
preg_match('|<input type="hidden" name="randkey" id="randkey" value="(.*?)">|si', $datarandkey, $randkey);
$postfield ="post edilecek veriler".$randkey[1]."diğer veriler";
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$postfield);
$goster = curl_exec($ch);