View Full Version : CAPTCHA field not showing
gjdunn405023
04-13-2010, 10:22 AM
Mac server, Dreamweaver, Navicat
All other elements in the form are working fine except the Captcha field. I've searched the forum, but nothing seems to fix it.
Jason Byrnes
04-14-2010, 07:06 AM
try browsing to the file that generates the captcha image:
WA_ValidationToolkit/WAVT_CaptchaSecurityImages.php
Post the results of browsing to that file, it should help us figure out what is going wrong.
gjdunn405023
04-14-2010, 07:41 AM
Fatal error: Call to undefined function imagecreatetruecolor() in /Library/WebServer/Documents/worldmix/UserRegistration100/WA_ValidationToolkit/WAVT_CaptchaSecurityImages.php on line 89
Jason Byrnes
04-14-2010, 07:47 AM
this means that the GD Library has not been enabled in your php server:
http://assets.webassist.com/how-tos/gd_library_ht.pdf
gjdunn405023
04-14-2010, 12:24 PM
That isn't much of a solution for mac.
The alternative to install MAMP simply installs another testing server; which I already have.
Apparently, what I need is the GD library installed into my php5.2; but nowhere is that option available.
Help!
Jason Byrnes
04-14-2010, 01:29 PM
there really isnt an easy solution for the mac.
the PHP server that is built into the MAC OS is not compiled with GD library support.
you would need to recompile the php server and include the string to compile it with GD support.
the MAC OS kernel is based on Linux, so the compiling php for mac is very similar to compiling it for linux. Here is a tutorial for compiling php fior linux:
http://www.e-gineer.com/v1/instructions/install-gd13-for-php-with-apache-on-linux.htm
sorry, i could not find one for mac.
the Simplest solution is to not use the MAC OS PHP testing server, and use MAMP instead, the mamp PHP server has been compiled with GD library support.
in reality, the user registration solution pack is intended to be uploaded to your host webserver so that site visitors can register to your site.
gjdunn405023
04-14-2010, 02:10 PM
Thanks for the response.
Perhaps I wasn't clear earlier. This IS my hosting computer. It's a mac Leopard server (10.5.8) running Apache 2.0 and php 5.2.12.
So the question remains how do I add the GD library to the host server? What version of php includes it? Or how do I add it?
So far, this doesn't seem like a mac-compatible software.
Jason Byrnes
04-14-2010, 02:28 PM
you would need to recompile the php server and include the string to compile it with GD support.
the MAC OS kernel is based on Linux, so the compiling php for mac is very similar to compiling it for linux. Here is a tutorial for compiling php fior linux:
http://www.e-gineer.com/v1/instructi...e-on-linux.htm
gjdunn405023
04-15-2010, 06:34 AM
The other solution is to disable the Captcha feature.
Can you describe how I should do that without endangering any other features?
Jason Byrnes
04-15-2010, 07:31 AM
see the "How to remove security features from your Contact Form" tutorial in the how to section of the Contact Form Solution pack support page:
http://www.webassist.com/support/contact-form/
gjdunn405023
04-15-2010, 11:52 AM
That's great, except that I'm using the UserRegistration Solution Pack.
Can you please direct me to the correct location. Thank you.
Jason Byrnes
04-15-2010, 12:05 PM
It is exactly the same process in the User Registration solution pack,
Delete the code to initialize the spry text field:
var sprytextfield9 = new Spry.Widget.ValidationTextField("sprytextfield9", "none", {minChars:5, maxChars:5, validateOn:["blur"]});
delete the captcha form element code:
<tr>
<th> </th>
<td><img src="WA_ValidationToolkit/WAVT_CaptchaSecurityImages.php?noisecolor=<?php echo $WAGLOBAL_Captcha_Noise; ?>&bgcolor=<?php echo $WAGLOBAL_Captcha_BG; ?>&textcolor=<?php echo $WAGLOBAL_Captcha_Text; ?>&transparent=<?php echo $WAGLOBAL_Captcha_BG_transparent; ?>&characters=<?php echo $WAGLOBAL_Captcha_Characters; ?>&width=<?php echo $WAGLOBAL_Captcha_Width; ?>&height=<?php echo $WAGLOBAL_Captcha_Height; ?>&font=<?php echo $WAGLOBAL_Captcha_Font; ?>" alt="security code" />
<input name="addblock" id="addblock" type="text" style="display:none" value="" />
<input name="secondblock" id="secondblock" type="text" style="display:none" value="" /></td>
</tr>
<tr>
<th>Security code:</th>
<td><span id="sprytextfield9">
<input name="Security_code" type="text" class="WAATKTextField" id="Security_code" onBlur="if (document.getElementById('Security_codeServerValid ation')) document.getElementById('Security_codeServerValida tion').style.display='none'" value="" size="32" />
<span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldMinCharsMsg">Minimum number of characters not met.</span><span class="textfieldMaxCharsMsg">Exceeded maximum number of characters.</span></span>
<?php
if (ValidatedField("usersRegistration","usersRegistration")) {
if ((strpos((",".ValidatedField("usersRegistration","usersRegistration").","), "," . "7" . ",") !== false || "7" == "")) {
if (!(false)) {
?>
<span class="textfieldServerError" id="Security_codeServerValidation">
Your security code did not match the image. </span>
<?php //WAFV_Conditional users_Registration.php usersRegistration(7:)
}
}
}?></td>
</tr>
and delete the server validation code:
$WAFV_Errors .= WAValidateLE(((isset($_POST["Security_code"]))?strtolower($_POST["Security_code"]):"") . "",((isset($_SESSION["captcha_1"]))?strtolower($_SESSION["captcha_1"]):"") . "",true,7);
elevy388997
04-15-2010, 04:28 PM
Hello,
my images aren't displaying either and my gd library is fine. Where the image should be, is an image that says "Security Code".
Jason Byrnes
04-16-2010, 07:26 AM
try browsing to the file that generates the captcha image:
WA_ValidationToolkit/WAVT_CaptchaSecurityImages.php
Post the results of browsing to that file, it should help us figure out what is going wrong.
gjdunn405023
04-16-2010, 12:30 PM
That worked. But your code is different than the sample on the pdf for Contacts (different lines too). Your code is more accurate.
Thanks for the help. No more Captcha.
vBulletin® v3.8.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.