PHP Javascript Free Capcha
Posted by admin on Thursday, November 13, 2008 · Leave a Comment
<div id="AvanceZone">
<?php
session_start();
if( isset($_POST['submit']))
{
$number1=rand(2,10);
$number2=rand(3,10);
$sum = $number1+$number2;
// For Debug For Debug For Debug For Debug For Debug For Debug
//
//echo "Session value is <b> ". $_SESSION['val'] . " </b>But Typed AS : <b>" . $_POST['security_code'] . ".</b><br />";
//
// For Debug For Debug For Debug For Debug For Debug For Debug
if( $_SESSION['val'] == $_POST['security_code'] )
{
echo 'Thank you. We Will Contact you Shortly';
}
else {
echo 'Sorry, you have provided an Invalid security code';
}
session_destroy();
}
else
{
?>
<form action="2.php" method="post">
<label for="security_code">
<?php
$number1=rand(2,10);
$number2=rand(3,7);
$sum = $number1+$number2;
$_SESSION['val']=$sum;
echo "Please Enter The Sum Of <b> ". $number1 . " </b>And <b>" . $number2 . ".</b><br />";
?>
</label>
<input id="security_code" name="security_code" type="text" /><br />
<input type="submit" name="submit" value="Submit" />
</form>
<?php
}
?>
</div>
Filed under php · Tagged with