Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Создать контекст и инициализировать POST запрос
- $context = stream_context_create(array(
- 'http' => array(
- 'method' => 'POST',
- 'header' => 'Content-Type: application/x-www-form-urlencoded' . PHP_EOL,
- 'content' => 'QUERY',
- ),
- ));
- // Отправить запрос на себя, чтобы запустить тесты
- echo file_get_contents(
- $file = "http://site.ru/post2.php", //этот скрипт должен ловить POST-запрос
- $use_include_path = false,
- $context
- );
- /* Так в скрипт придёт один элемент с именем QUERY
- array(1) {
- ["QUERY"]=>
- string(0) ""
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement