▽1
●
TransFreeBSD ●200ポイント ベストアンサー |
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に変えます。