redarrow Posted February 22, 2007 Share Posted February 22, 2007 how to get the strings to match cheers. <?php $fileRand = md5(rand(100000,999999)); $string_a = array("A","B","C","D","E","F","G","H","J","K", "L","M","N","P","R","S","T","U","V","W","X","Y","Z", "2","3","4","5","6","7","8","9"); $keys = array_rand($string_a, 6); foreach($keys as $n=>$v){ $string .= $string_a[$v]; } if($_GET['cmd']=="protect"){ if($x==$s){ echo"correct"; }else{ echo"incorrect"; } } ?> <p></p> <table align="center" width="600" border="4" bordercolor="black"> <td align="center"> <table width="290" border="4" bordercolor="black"> <td align="center"> <form method="POST" action="register.php?cmd=protect&string_result=<?php echo $string?>"> <br> <font color="yellow">Username <br> <input type ="text" name="name"> <br> <br> Password <br> <input type="password" name="password"> <br> <br> Valid Email Address</font> <br> <input type="text" name="mail"> <br> <br> <?php echo "<font color='blue'>$string</font>";?> <br> <input type="string" name="s" value="Please enter code... "> <input type="hidden" name="x" value="<?php $x=$_GET['string_result'];?>"> <br> <br> <input type="submit" name="submit" value="Register"> <br> </form> </table></td> Link to comment https://forums.phpfreaks.com/topic/39669-gotcha-help/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.