Skip to content

Instantly share code, notes, and snippets.

@blackhalt
Created August 25, 2013 07:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blackhalt/6332404 to your computer and use it in GitHub Desktop.
Save blackhalt/6332404 to your computer and use it in GitHub Desktop.
file_get_contents un POST
<?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