http://www.phpcaptcha.org/
一ページに複数個の認証登録フォームを設置したいのですな、やり方はわかりますでしょうか?
namespaceを使うようです。
https://github.com/dapphp/securimage/blob/master/securimage.php#L427
試していませんが、下記でどうでしょう。
form.html
<form method="post" action="comment_form.php"> <img src="./securimage_comment.php"><br /> <strong>Enter Code*:</strong> <input type="text" name="captcha" /> </form> <form method="post" action="contact_form.php"> <img src="./securimage_contact.php"><br /> <strong>Enter Code*:</strong> <input type="text" name="captcha" /> </form>
securimage_comment.php
<?php require_once 'securimage.php'; $img = new Securimage(); $img->namespace = "comment"; $img->show();
comment_form.php
<?php require_once 'securimage.php'; $img = new Securimage(); $img->namespace = "comment"; if ($image->check($_POST['captcha']) == true) { echo "Correct!"; } else { echo "Sorry, wrong code."; }
contactはcommentをcontactに変えます。
はい。これで大丈夫でした!
2014/02/02 16:23:37