Ch3vr0n Posted August 14, 2006 Share Posted August 14, 2006 Hy there folks, on my website i have a couple forums that have been massively abused by robots and spiders lately. For the past couple days i have been looking for a php script (thats easy to embed in current form) but to no luck. The ones i did fid required the GD librairy ?? , or failed to show the image (even with the correct font uploaded).Now my question is, can anybody script such a thing (pref without the GD librairy whatever it is), or know one ? Because without such a thing i cannot bring the forms back online (and they already have a scriptpart that checks for empty fields that are obligated).Catch my drift, i really need this. Quote Link to comment Share on other sites More sharing options...
AndyB Posted August 14, 2006 Share Posted August 14, 2006 with GD, my captcha script is at www.digitalmidget.com/php_noob2006/captcha.phpwithout GD you could use a fake image that either never changes or is randomly selected from a group - a sort of pseudo-captcha - along with the requisite 'values' in an array accessed by your checking script. Quote Link to comment Share on other sites More sharing options...
Tatara Posted August 14, 2006 Share Posted August 14, 2006 also many host have the gd library already installed with php and as of PHP 4.3 there is a bundled version of the gd library Quote Link to comment Share on other sites More sharing options...
Ch3vr0n Posted August 14, 2006 Author Share Posted August 14, 2006 k i upped your captcha script, but in the place of the image i'm getting a red cross (as with the other scripts), this means that the GD2 is not installed ? Can i load externally to your script, or can it be modified to a solid bg or something ? If it cannot and i have to ask my provider to install the GD librairy, where does he need to put it and what needs to be done, or is there an alternative. I'd rather have generated ones, then an array since the prior is more secure. Quote Link to comment Share on other sites More sharing options...
AndyB Posted August 14, 2006 Share Posted August 14, 2006 You can check to see if you have the GD library installed by viewing your site's php information:[code]<?phpphpinfo();?>[/code]Save as phpinfo.php, upload to your site, then visit it. If you have GD installed, it'll appear in the list og goodies there. GD2 and GD in general has been around long enough that any decent host would provide it as part of their hosting package ... espcially since it's open source and free. Your host will know how to recompile php with GD support (if not, you need another host - fast). Quote Link to comment Share on other sites More sharing options...
Ch3vr0n Posted August 14, 2006 Author Share Posted August 14, 2006 [quote]gdGD Support enabled GD Version bundled (2.0.28 compatible) FreeType Support enabled FreeType Linkage with freetype GIF Read Support enabled GIF Create Support enabled JPG Support enabled PNG Support enabled <==WBMP Support enabled XBM Support enabled [/quote]yet the image is not generated. Next step ? The full info can be viewed here http://www.fastrax.be/chevron/imggen/test.php Quote Link to comment Share on other sites More sharing options...
AndyB Posted August 14, 2006 Share Posted August 14, 2006 I hope the instructions in the download were perfect ;DSounds like a difference between the way you have things set/named and how my script requires them. It's supposed to work 'out of the box' when everything is uploaded into the same relative structure as the zip file without changes. Quote Link to comment Share on other sites More sharing options...
Ch3vr0n Posted August 14, 2006 Author Share Posted August 14, 2006 instructions were clear, didnt modify anything yet. That's exactly the problem. GD is version 2.0.28 as in the quote so it should work. Can it be it has problems with dynamic generated images ? Ifso, can it be set to use static jpg's ? Quote Link to comment Share on other sites More sharing options...
Ch3vr0n Posted August 15, 2006 Author Share Posted August 15, 2006 update, i found the bug (with help of my provider). In the captcha_image.php the config file gets called from the dir captchas/captcha_config.php , but while unzipping it gets extracted into the main dir. So it was just a way of moving the file or removing the captcha/ part in the config file on line 3. 2 last questions. 1) As extra security i would like to ad the small letters too. Currently it only uses CAPS & numbers, but when i add the lowerercase letters too i get securitycode mismatch. Can i do this or should i leave it ?2) Is it possible to have a rotating background (this is optional) ? Quote Link to comment Share on other sites More sharing options...
willpower Posted August 16, 2006 Share Posted August 16, 2006 i wrote my own script to enable the background images to fit with the style of the site (sad...i know)I can let you have the full scirpt if you want. It is rather simple but in princple it does this.Sets a background image from a folder.Opens a fonts folderSelects a random fontselects a random number from 0-9repeats this to get a series of 5 numbers in random fonts (and x,y co-ords) Then generates a complete image with session variable.Let me know if this would be of use Quote Link to comment Share on other sites More sharing options...
Ch3vr0n Posted August 20, 2006 Author Share Posted August 20, 2006 sry will. I've already implemented this one. Thx for the offer but im not gonna start all over from scratch again.AndyB is there a possibilty on the stuff i asked? Quote Link to comment Share on other sites More sharing options...
AndyB Posted August 20, 2006 Share Posted August 20, 2006 Thanks for the update. I've fixed the mis-location in the zip!!The script 'as is' intentionally omitted some characters that might be confused (0 and O, 1 and I) and upper-case seemed like enough variability. In case people 'forgot' to enter the security code in upper-case, the script changed all input to upper-case before testing with this line:[code]$secure = strtoupper(trim(strip_tags($_POST['secure'])));[/code]If you want to add lower case letters to those available, you can ... as long as you change that line above here to this:[code]$secure = trim(strip_tags($_POST['secure']));// leave case as entered[/code] Quote Link to comment Share on other sites More sharing options...
Ch3vr0n Posted August 21, 2006 Author Share Posted August 21, 2006 any chance on rotating bg's either ? but thats just as an extraupdate. Lowercase : worked like a charm mate. Thx for the script. Maybe ill give ya some credit on my website once the changes go live ;) Quote Link to comment Share on other sites More sharing options...
AndyB Posted August 21, 2006 Share Posted August 21, 2006 Remember that the script as written chooses a random section of the background to use as the captcha. If you want a randomly chosen background, then edit the captcha_config.php file to replace this line:[code]$background = "captchas/random-back-image4.jpg"; // this is the image used for random background creation[/code]With these lines:[code]$backs = array("random-back-image4.jpg", "another-image.jpg", "different-image1.jpg"); // as many as you want as long as they all exist!!$background = "captchas/". $backs[rand(0,count($backs)-1)];// a random background[/code]Obviously the differently named background have to exist and be in the same folder as the original background image. You can add as many as you want to the $backs array. It's untested but highly likely to work. If it does, you owe me a beer ;D Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.