Новичок
Профиль
Группа: Участник
Сообщений: 3
Регистрация: 15.3.2009
Репутация: нет Всего: нет
|
У меня есть код Код | <?php include ("config.php"); if(isset($_POST['B1'])) { if(empty($_POST['from']) or empty($_POST['to']) or empty($_POST['subj']) or empty($_POST['mess'])) {echo'<center><b>Поля не заполнены!</b></center>'; exit();} $from = $_POST['from']; $to = $_POST['to']; $subj = $_POST['subj']; $mess = $_POST['mess'];
$fo = fopen("fromid","w+"); fwrite($fo,$from); fclose($fo); $from = file_get_contents("fromid"); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "site.ru"); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_POSTFIELDS, ""); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiesfiledir); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiesfiledir); $all = curl_exec($ch); curl_close($ch); preg_match('/name=\"111\" value=\".*\"/', $all, $matches); $chas1 = $matches[0];
preg_match('/value=\".*\"/', $chas1, $matches2); $chas2 = $matches2[0];
preg_match('/\".*\"/', $chas2, $matches3); $chas3 = $matches3[0];
preg_match('/.*/', $chas3, $matches4); $chas = $matches4[0];
$chasg = substr($chas, 1,-1);
preg_match('/name=\"222\" value=\".*\"/', $all, $matches); $secure1 = $matches[0];
preg_match('/value=\".*\"/', $secure1, $matches2); $secure2 = $matches2[0];
preg_match('/\".*\"/', $secure2, $matches3); $secure3 = $matches3[0];
preg_match('/.*/', $secure3, $matches4); $secure = $matches4[0];
$secureg = substr($secure, 1,-1);
$ch2 = curl_init(); curl_setopt($ch2, CURLOPT_URL, "site.ru"); curl_setopt ($ch2, CURLOPT_POST, 1); curl_setopt ($ch2, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch2, CURLOPT_POSTFIELDS, "lalalala"); curl_setopt($ch2, CURLOPT_HEADER, 0); curl_setopt($ch2, CURLOPT_COOKIEJAR, $cookiesfiledir); curl_setopt($ch2, CURLOPT_COOKIEFILE, $cookiesfiledir); $all = curl_exec($ch2); curl_close($ch2);
$from = $from+1; $fo = fopen("fromid","w+"); fwrite($fo,$from); fclose($fo);
if($from == $to) {echo'<center><b>Завершено</b></center>'; exit();} } ?>
|
вопрос: как сделать так, что бы он повторно выполнился, желательно с этого момента где Код | $fo = fopen("fromid","w+"); fwrite($fo,$from); fclose($fo); $from = file_get_contents("fromid"); $ch = curl_init(); ..............
|
|