Частый гость
Покинул форум
Сообщений всего: 213
Дата рег-ции: Май 2010
Откуда: Россия, Ростов-на-Дону
Помог: 3 раз(а)
|
Вот что я написал:
PHP:
скопировать код в буфер обмена
<?PHP function curl($url) { // if($cookies)$coockes = tempnam( './tmp', 'cookie' ); curl_setopt($ch, CURLOPT_USERAGENT , "Opera/9.80 (Windows NT 5.1; U; MRA 5.4 (build 02652); ru) Presto/2.2.15 Version/10.00"); curl_setopt($ch, CURLOPT_REFERER , "http://sky-phoenix.ru/index.php"); // curl_setopt( $ch, CURLOPT_COOKIEJAR, './tmp/cookies.txt' ); //curl_setopt($ch, CURLOPT_COOKIEFILE, H.'/tmp/cookies.txt'); // if($cookies)curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true ); { } return $html; } $page_text = curl("http://sky-phoenix.ru/index.php"); preg_match_all('/<input type = \'hidden\' name = \'xxx\' value = \'(.*)\' \/>/U', $page_text, $s); $_SESSION['var'] = $s[1][0]; ?> <html> <head> <title>Страница с формой</title> </head> <body> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <form action = 'form_sender.php' method = 'POST'> <input type = 'text' name = 'string' value = 'Введите текст' /> <? echo "<input type = 'hidden' name = 'xxx' value = '" . $s[1][0] . "' />"; ?> <input type = 'submit' name = 'Отправить' /></form> </body> </html> <? }else{ $url = "http://sky-phoenix.ru/index.php"; 'string' => "$_POST[string]", 'xxx' => "$_SESSION[var]", 'Отправить' => "", ); curl_setopt($ch, CURLOPT_USERAGENT , "Opera/9.80 (Windows NT 5.1; U; MRA 5.4 (build 02652); ru) Presto/2.2.15 Version/10.00"); curl_setopt($ch, CURLOPT_REFERER , "http://sky-phoenix.ru/index.php"); echo "Успешно ", $_SESSION['var'], "<br>"; } ?>
|