Created
August 25, 2013 07:00
-
-
Save blackhalt/6332404 to your computer and use it in GitHub Desktop.
file_get_contents un POST
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
die(); // Aizkomentē, ja vajag ;) | |
# Cepumus vajag? | |
$cik_reizes = 1000; | |
$data = 'poll_question_id=4204&poll_answer_id=24693'; | |
$opts = array( | |
'http' => array( | |
'method' => 'POST', | |
'header' => "Content-type: application/x-www-form-urlencoded\r\n" . "Content-Length: " . strlen($data) . "\r\n", | |
#."Cookie: foo=bar\r\n" | |
'content' => $data | |
) | |
); | |
$context = stream_context_create($opts); | |
for ($i = 1; $i <= $cik_reizes; $i++) { | |
$file = file_get_contents('http://www.tvnet.lv/zinas/poll_archive', false, $context); | |
echo "$i\n"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment