Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if($_POST)
- {
- print_r($_POST);
- die();
- }
- $postdata = http_build_query(
- array(
- 'var1' => 'some content',
- 'var2' => 'doh'
- )
- );
- $opts = array('http' =>
- array(
- 'method' => 'POST',
- 'header' => 'Content-type: application/x-www-form-urlencoded',
- 'content' => $postdata
- )
- );
- $context = stream_context_create($opts);
- $url="http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
- $result = file_get_contents($url, false, $context);
- print_r($result);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement