Yeah, I think I should explain in details
I try sample script on MODx CMS version 0.9.2.1 - 0.9.6.1p2
PHP/4.3.11
Apache, Linux
Form is very Simple.
<?php
if (empty($_POST)) {
echo "<form method=’POST’>Username:
<input type=’text’ name=’username’ />
Password:
<input type=’text’ name=’password’ />
<img src=’/securimage/securimage_show.php?sid=".md5(uniqid(time()))."’>
<input type=’text’ name=’code’ />
<input type=’submit’ value=’Submit Form’ /></form>";
} else {
include($_SERVER[’DOCUMENT_ROOT’] . ’/securimage/securimage.php’);
$img = new Securimage(); //create phpcaptcha object
$valid = $img->check($_POST[’code’]); //check code from input
if($valid == true) {
echo ’<center>Thanks, you entered the correct code.</center>’; }
else {
echo ’<center>Sorry, the code you entered was invalid. <a href=\’javascript:history.go(-1)\’>Go back</a> to try again.</center>’;
}
}
?>
As I mentioned above, the same code outside MODx CMS works correct. Inside MODx I always receive the same message after submitting form: "Sorry, the code you entered was invalid. "