I searched the web and found nothing.
On the website, there is a Input box for a E-Mail address. I would like to fill this field with an e-mail address and the send the form. I found this code:
$postdata = http_build_query(
array(
'email' => 'youremailaddress'
)
);
$opts = array('http' =>
array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => $postdata
)
);
$context = stream_context_create($opts);
$result = file_get_contents('http://example.com/submit.php', false, $context);
But in my case, the action file is the current page itself and the url is rewritted. So when I put the url like this:
$result = file_get_contents('http://example.com/login.html', false, $context);
var_dump($result);
I get the page but the form is not sent