I have simply script:
<?php if($_POST){
if($_POST['captcha'] == 'random'){ ?>
<div id="answer">
<?php echo $_POST['captcha'] . uniqid(); ?>
</div>
<?php
}
} ?>
<form name="contactform" method="post" action="">
email: <input type="text" name="email"> <br />
###IMAGE###: random <br />
captcha: <input type="text" name="captcha">
<input type="submit" value="Submit">
</form>
captcha is random, but for this test i use always ‘random’. This script working OK.
So – i would like open this site and fill in captcha and submit form and receive data from DIV #answer.
I create:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost/script.php');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$output = curl_exec($ch);
curl_close($ch);
print_r($output);
This show me form, but if i fill in captcha and submit form then this not handles $_POST.
How can i make it? I must first fill captcha.
try this:-