F.A.Q.


This FAQ contains some of the more common issues that are encountered when trying to configure Securimage. Please post a question if your problem is not addressed here or feel free to use the contact form to ask your question directly.

Some of the problems that are encountered may require some basic PHP knowledge in order to troubleshoot and solve therefore some of these answers may be geared towards more advanced users. If you cannot easily get Securimage working it may be necessary to get help from a skilled PHP developer.

 
If this error appears it means PHP does not have GD support which is required for creating images with PHP. Unfortunately, if you get this error Securimage will not work.

GD has been included with PHP since version 4.3 but some older PHP installations do not support it. You will need to contact your webhost to request GD support, or recompile PHP with GD support if you are running Securimage on your own server.

See the Installing/Configuring GD page on php.net for more information.
This problem may indicate that your version of PHP does not have GD support as indicated in the previous FAQ question but it is possible that Securimage will still work. Depending on your PHP and GD versions this function may not be defined.

To have Securimage use the regular imagecreate() function a background image must not be used and transparent text needs to be turned off. Under these two conditions the imagecreate() function will be used.

Note: This function will not work with GIF images. It is recommended to use the PNG format for your images.
Your version of PHP does not have FreeType support built in. FreeType must be installed in order to use TTF fonts.

You can still use Securimage but you will need to use GD fonts instead of TTF fonts. It is advised to use TTF fonts if possible as certain features of Securimage will not work when using GD fonts (i.e. multiple letter colors, image distortion, transparent text, angled text). GD fonts are also system dependent and can be difficult to find.
If the code does not appear on the image it usually means one of two things. Either the path to the TTF file is incorrect or there is a problem displaying transparent text in the PHP and GD version you are using.

First see if the text will appear by setting use_transparent_text to false (ex. $img->use_transparent_text = false;).

If the text still does not appear, you will need to make sure the path to the TTF font file is correct and that the font file is accessible. It is recommended to use an absolute path to the TTF file. This varies between configurations and web hosts but some examples are (/home/yoursite/public_html, /var/site/html for Unix/Linux or C:\inetpub\wwwroot on Windows). If you are unsure of the path, check with your host or try the following code: $img->ttf_file = $_SERVER['DOCUMENT_ROOT'] . '/securimage/font.ttf'; The font name and Securimage folder will depend on where it was uploaded and what font is uploaded.
Make sure that the URL specified in the HTML img tag points to the proper location of securimage_show.php. To be sure you can use the full address (i.e. http://yoursite.com/securimage/securimage_show.php).

To verify that another problem doesn't exist, try viewing the image directly in your browser by going to securimage_show.php in your browser.
A fatal PHP error may have occurred that is preventing the image from displaying and the PHP configuration is not set to show error messages. To enable error display add the following code just after <?php in your securimage_show.php script: ini_set('display_errors', 'on'); error_reporting(E_ALL);

After saving the file with those changes go to securimage_show.php in your browser to see if any errors are displayed that can help in determining why the image is not showing.
This means that the path to securimage passed to the include statement was not found. You will need to change the include "securimage.php"; line to point to the correct location. The paths vary between servers and configurations but this is the absolute path to securimage.php. In 99.9% of scenarios using include "/securimage/securimage.php"; is incorrect.

If you are unsure of your path, contact your host or try changing the include to include $_SERVER['DOCUMENT_ROOT'] . '/securimage/securimage.php';.
Securimage depends on PHP sessions to store the CAPTCHA code in between requests to the server. Because most sessions use cookies, a header must be sent to the user's browser and headers MUST be sent before any portion of the page content is displayed.

Securimage will attempt to attach itself to an existing session but will attempt to create a new one if one does not exist. Because of this, your code must have a session established or securimage.php must be included before any HTML is sent. The easiest way to solve this is to start a session at the very beginning of the first page that is named in the error message (page.php as shown above). To do this use <?php session_start(); ?> on line 1 of the page.

If you are integrating securimage.php into an existing software platform you should make sure starting a session yourself will not interfere with its operation.
1. Cookies must be enabled in the client's browser or the validation will always fail! To allow users with cookies disabled you must use the new SQLite database option in Securimage.

2. Check to make sure the HTML input tag's name attribute for the captcha code input is the same name that is being checked in your validation code. If your form uses <input type="text" name="captcha_code" /> then the form processor must reference $_POST['captcha_code'] when calling $Securimage->check().

3. If the variable names are the same this may be due to a problem with the PHP session that is used to keep track of the user and what their code is. It is possible that the session was not started or more likely that the session name being used in securimage_show.php differs from the session name used in the script that does the code validation. It is common for other software platforms (forums, content management systems, form processors etc.) to use a session name other than the PHP default. If this is the case, you must determine what session name is used by the software and use the same session name in securimage_show.php and securimage_play.php.

A non-default session name can be passed to Securimage so it can share a session with another software platform with the following code: $img->session_name = 'your_session_name';

Note: Securimage will NEVER destroy a session so it is safe to use with systems that persist user data with sessions; it only changes its own session variables.

  1. 71 Responses to "F.A.Q."

  2. hi, we had made a spanish translation available here , wich you linked at documentation section.
    in case you lost old site content i resend you the link.
    http://www.micromediaargentina.com.ar/bonus/web/php/captcha-validar-formularios/usando-un-captcha-foto-rotativa-aleatoria.php

    cheers.

    By matiasn on Aug 1, 2008

  3. Fantastic script – thanks very much.

    By Luke on Sep 1, 2009

  4. Hi,

    Great script. Though some of our users complained that CAPTCHA shows error "The code you entered was incorrect. Go back and try again." Even though the code is correct.

    Any suggestion?

    By Gaurav on Nov 21, 2009

  5. Since PHP sessions use cookies to track the user, if they have cookies disabled it will always result in an incorrect code. The only other option is to turn off transparent sessions with the configuration setting 'use_trans_sid' but this is considered a security risk. You can also note on the form that the user must have cookies enabled.

    By Drew on Nov 22, 2009

  6. I am test CAPTCHA Secureimage on my zencart site,
    and I am getting the "incorrect code" error.

    I saw the code fix above, and I just need to know where to put the following line of code:

    $img->session_name = 'your_session_name';

    I found my session name (zenid), but where do I put the above code??

    Thanks!

    By Reed on Nov 23, 2009

  7. Hello Drew,

    You are right ! I sent this solution to our customers. Let me wait for the answer.

    I was concerned about this because I was able to login easily, but some of the users can't.

    Thanks. Appreciate your help. I will get back with customers answer :)

    By Gaurav on Nov 23, 2009

  8. You can put it in securimage_show.php right before $img->show();

    By Drew on Nov 24, 2009

  9. Hi – everything seems to be installed correctly, but I can still hit send without entering the code and the mail still goes through. Below my PHP code:

    "smtp.imaginet.co.za",
    "auth" => true,
    "username" => "Mail@theleatts.co.za",
    "password" => "#######"
    );

    $mail = Mail::factory("smtp", $paramsSMTP);

    $recipient = "#######";
    $headers['From'] = $_POST['Email'];
    $headers['To'] = "#######";
    $headers['Subject'] = 'Website Feedback – http://www.posthouse.co.za – ' . $_POST['name'] . " " . $_POST['surname'];
    $body = $_POST['Body'];
    $mail->send($recipient, $headers, $body);

    if ($securimage->check($_POST['captcha_code']) == false) {
    // the code was incorrect
    // handle the error accordingly with your other error checking

    // or you can do something really basic like this
    die('The code you entered was incorrect. Go back and try again.');
    }

    ?>

    Please help!

    By JP Greeff on Nov 24, 2009

  10. The reason is because the code validation is done after the email is already sent. You want to check the code along with the other form validation before the email is sent.

    The way it is now no matter what code they enter it doesn't get checked until all of your processing is already done.

    By Drew on Nov 24, 2009

  11. Hi Drew – Thanx for the quick reply. I'm VERY new to PHP. The mail form is code that was provided to me by the host. Where do I add this code then?

    By JP Greeff on Nov 24, 2009

  12. There may be a better place to put it but as you said since the php tags were getting cut off you could put it just above the code you had posted. This way if the code is incorrect it will cause the script to stop just before the mail is actually sent.

    Usually, I recommend checking the code after all other form validation and only checking it if there were no other errors with the form input.

    By Drew on Nov 24, 2009

  13. Thanx Drew: Code Follows: Without the PHP Bits at beginning and end:

    include_once $_SERVER['DOCUMENT_ROOT'] . '/securimage/securimage.php';
    $securimage = new Securimage();

    if ($securimage->check($_POST['captcha_code']) == false) {
    // the code was incorrect
    // handle the error accordingly with your other error checking

    // or you can do something really basic like this
    die('The code you entered was incorrect. Go back and try again.');
    }

    require_once("Mail.php");

    $paramsSMTP = array(
    "host" => "smtp.imaginet.co.za",
    "auth" => true,
    "username" => "Mail@theleatts.co.za",
    "password" => "######"
    );

    $mail = Mail::factory("smtp", $paramsSMTP);

    $recipient = "######";
    $headers['From'] = $_POST['Email'];
    $headers['To'] = "#####";
    $headers['Subject'] = 'Website Feedback – http://www.#####.co.za – ' . $_POST['name'] . " " . $_POST['surname'];
    $body = $_POST['Body'];
    $mail->send($recipient, $headers, $body);

    By JP Greeff on Nov 24, 2009

  14. Hello Drew. I have been using your Securimage product for a couple of days now. I seem to have everything coded and working on my test machine. When the correct letters and numbers are entered, it works. When I click on the audio link, the letters and numbers that are recited are the correct letters and numbers.

    I recently moved my changed pages along with the supporting files and folders to my production Webhosting company's server. When I pull up the page, I see the Captcha image along with the reload and sound images. The reload image works.

    The sound image, when clicked, recites "other" letters and numbers – not the ones that are displayed in my Captcha box.

    Also, when I type in the letters and numbers that are displayed in my Captcha box, I get a "failure" message – as if the letters and numbers were typed incorrectly.

    I added the Session_Name to my files (as you noted above) and assuming I did all of it correctly, it didn't help my problem – I still can't seem to get this thing to work on my production server.

    My test server is running PHP 5.1 (Captcha works)
    My production server is running 4.4.8 (Captcha doesn't work)

    Can you think of anything else I should try?

    Thank you very much!
    Jesse

    By Jesse on Nov 25, 2009

  15. Hi Drew, many thanks for you script – exacly what I was after.

    The only problem is that it only validates if all of the characters are entered in lowercase, even the ones that are show as upper case in the image. Is there a way to make it so that characters have to be entered in the case shown?

    Many Thanks
    Izzy

    By Izzy on Dec 10, 2009

  16. Currently the script is not case-sensitive as many users do not enter codes case sensitively without going through one incorrect entry.

    Without making a few modifications to the saving and checking of the code it is not possible to do this – perhaps it will be an option in a future version. Sorry.

    By Drew on Dec 10, 2009

  17. Hi,
    I had a problem with short captcha-word in little captcha-box displaying in IE7. I was need to display captcha 84px:25px with 6-letters inside. Image was not redrowing on page refrash. During the tests I had found that some size modifications (heigth to 400px or width to 800px) makes the captcha to be displayed correctly – with 6-letters word inside, otherwise it was displayed with some old long text in some old sizes.
    So, I deside that the real problem is that little size image don't wont to be displayed because of some big image size images caching. So, i had look tou the code you use for cache disabling -
    header("Expires: Sun, 1 Jan 2000 12:00:00 GMT");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
    etc.
    I have change it to some other code I have use in my previouse projects – and problem is fixed now: any size images are displayed correctly after refresh.
    So, code I propose you is:
    header("Cache-Control: no-store, no-cache, must-revalidate");
    header("Expires: " . date("r"));
    That's all. I can give you some sources about why this code is correct – but all of them are in Russian, for example this:
    http://nomagic.ru/all.php?aid=58

    By Serge on Dec 14, 2009

  18. I am using forms in a Yahoo store and your anti spam tool was working fine until last week.
    Not anymore…

    I got an error message even if I type the correct code, Securimage always says it is wrong…

    I saw in the FAQ to ad code for session.

    I added this in securimage to get the software session name:

    $km_session_name=session_name();
    session_start();

    and I added this one in both show and play:
    $img->session_name = $km_session_name;

    What I echo on the error page, it shows $km_session_name is null.
    is there another way for me to get the curent session name?

    I am not sure I understand what else can I do???

    Thanks for your help, in adavnce!!

    Ka

    By Ka on Dec 15, 2009

  19. Hi when I run the following code as validation, the php script doesn't work.
    Why would this be?
    (securimage 1.0.1.3)

    … some more php code
    if (($captcha_code == "")) {
    exit;
    }

    // check captcha code
    session_start();
    include("/securimage/securimage.php");
    $img = new Securimage(); //check($_POST['captcha_code']);
    if($valid == false) {
    exit;
    }
    … some more php code

    By Bart Mertens on Dec 22, 2009

  20. hi, and thx for the script.
    is there any way to ad a LINK to the captcha image ?

    By miguel on Dec 24, 2009

  21. hi, I want try to create a new series of audio files (wav and mp3) in italian language. I have create new series of wav files (11025Hz) and mp3 files (16KHz) but, after the substitution, the captha player read only the first letter (or number). I use Audacity for the audio files creation. What is the correct type of the files, for correctly run? thanks

    By ettore on Jan 1, 2010

  22. This is really nice, easy to setup and robust piece of software. Really appreciate the effort. I have a question though.
    Is there a way to setup multiple instances of securimage on same page and then verify the code entered for that particular instance? I was able to create multiple instances on one page but the code verification only works for the last created instance.

    Can someone please tell me if its even possible? or any workaround to get it done? Thanks.

    PS. I posted this question earlier on the Quick Start Guide page but I think this is more appropriate. You can delete the comment from there. Sorry for the inconvenience.

    By Waqas on Jan 5, 2010

  23. It didn't work for me at first; it rejected every submission whether it was correct or not. For some reason, $_SESSION['securimage_code_value'] wasn't being set.

    Eventually, I managed to fix this problem by changing the form action attribute from an absolute to a relative URL.

    Hope this helps someone.

    By Michael on Jan 5, 2010

  24. Ditto, to Michael's post. When form and process pages are in same directory, use relative URL. If in different directories, use absolute. Weird but it worked for me.

    By Stephen on Jan 13, 2010

  25. hi
    i have several questions:
    1- i try to change the number of letters .
    i tried:
    $image = new $securimage();
    $image->code_length = '3';
    but it does not work.
    the same with image size and others (like number of lines).

    2- can i uae securimage on any site? are there restrictions?
    best regards

    By ron on Feb 8, 2010

  26. Hello,

    I like to use 2 captcha's at the same time in 2 different forms (in 2 browser tabs).
    When i check the registered Session captcha code i see only 1 code "securimage_code_value = lhcd" for the first form. When i request an other form with an other captcha image2, i will see a new registered session-var "securimage_code_value = ke7y".
    When i tab back to the first form, the captcha code is not valid anymore, because the 2nd form has registered a new captcha code and overwrite the session-var "securimage_code_value".

    I think i need 2 registered session-vars (for each form-captcha an own registered captcha-code) like:
    securimage_code1_value
    securimage_code2_value

    Can you tell me this is possible? And how?

    Regards,
    Guido

    By Guido Lemmens on Feb 11, 2010

  27. Is there a way to change the size of the font? I am using the TTF font that came with the securimage download. However, I find that if I reduce the size of the image via, $img->image_width, to lower than ~230, letters on the right hand side 'falls off' the edge of the image. This should be obvious but I can't find the setting.

    By George on Feb 11, 2010

  28. Great script. How would i implement radio buttons. I have used checkboxes no problem.

    Thank You

    By John on Feb 12, 2010

  29. I get the following error after submitting my form to my validation script:

    Warning: Failed to load GD Font file gdfonts/automatic.gdf in C:\xampp\htdocs\securimage\securimage.php on line 844

    Any ideas how to resolve this?

    By rajend3 on Feb 18, 2010

  30. Just a little information for evrybody…

    If you make you .mp3 files don't foget to remove the IDTAG because it's a problem for the stream whith the flash player and you have only the 1 word.

    By fredlynx on Feb 22, 2010

  31. HELP PLEASE!! First, it seemed to work and would send the message but pull up a weird error message. I reloaded the php pages and now the Script seems to run as if it's working but it's not sending that actual eMail?? I assigned the email address in the process.php page.. Very confused. Any advice would be greatly appreciated.

    By Firefighter Po on Feb 23, 2010

  32. Our captcha works fine with internet explorer…however with Firefox we receive an "invalid captcha code entered" every time, even though we enter the correct code. Can anyone think of what the difference might be? Firefox 3.5.8

    Thanks!

    By Tom C on Mar 7, 2010

  33. i setup this captcha for a joomla component but it seem joomla does not understand the session in file securimage.php and the result is always incorrect ? you have any recommend ?

    By rikka on Mar 10, 2010

  34. Thank you for your code but I do have a problem and I'm doing something wrong i guess. I see the code in my page, but if I enter the right code it works well, but if I enter the wrong code, the submit button also works, only the 'thank you' text after submitting is extended by the text 'wrong code, try again'…..can you tell me what I did wrong and how i can fic it? it might me the place and order of the code in de php file maybe?

    please help (php code on http://www.dnage.nl/pages/post.php

    By Liesbeth on Mar 11, 2010

  35. Hi there,

    The $img->session_name not work. Still it's constant = 'securimage_code_value'

    By Vinh Nguyen on Mar 17, 2010

  36. Hello,

    I need some assistance getting the AJAX implementation to work consistantly for poorly/non AJAX implemention in browsers. How can I programmatically read the image code (the same place that Flash reads the code from)? Please let me know your appropriate charge.

    Thank you in advance.

    Kimball

    By Kimball Hall on Mar 24, 2010

  37. Hi there, I'm using custom session creation, that is, I'm storing sessions on a database and found that I had to modify the file secureimage.php just before session_start(); to add my custom session initialization parameters

    Of course, now that I SEE the solution it seems to be ridiculously logical, however it wasn't like that at the beginning

    Hope this helps

    By Jimmy L on Mar 27, 2010

  38. Hi,

    I don't seem to see any text on the captcha image. Having read the FAQ's, I have adjusted transparency and also put an absolute path to the securimage_show.php file.

    Still can't get to work though. Also, my server does support GD and Freetype.

    Any assistance much appreciated!

    Thanks

    By Kam on Apr 9, 2010

  39. Hello,
    the Captcha image is not displaying (see link above).
    But On my development machine (local host) it works fine.
    When I try to call the securimage_show.php file I get the following warnings :

    Any idea about the cause ?

    Warning: session_start() [function.session-start]: open(/mnt/162/sdd/f/b/alexis.hernot/sessions/sess_c5456bcb492df3b0a11d00eb3a158875, O_RDWR) failed: No such file or directory (2) in /mnt/162/sdd/f/b/alexis.hernot/securimage/securimage.php on line 513

    Warning: session_start() [function.session-start]: Cannot send session cookie – headers already sent by (output started at /mnt/162/sdd/f/b/alexis.hernot/securimage/securimage.php:513) in /mnt/162/sdd/f/b/alexis.hernot/securimage/securimage.php on line 513

    Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at /mnt/162/sdd/f/b/alexis.hernot/securimage/securimage.php:513) in /mnt/162/sdd/f/b/alexis.hernot/securimage/securimage.php on line 513

    Warning: Cannot modify header information – headers already sent by (output started at /mnt/162/sdd/f/b/alexis.hernot/securimage/securimage.php:513) in /mnt/162/sdd/f/b/alexis.hernot/securimage/securimage.php on line 1050

    Warning: Cannot modify header information – headers already sent by (output started at /mnt/162/sdd/f/b/alexis.hernot/securimage/securimage.php:513) in /mnt/162/sdd/f/b/alexis.hernot/securimage/securimage.php on line 1051

    Warning: Cannot modify header information – headers already sent by (output started at /mnt/162/sdd/f/b/alexis.hernot/securimage/securimage.php:513) in /mnt/162/sdd/f/b/alexis.hernot/securimage/securimage.php on line 1052

    Warning: Cannot modify header information – headers already sent by (output started at /mnt/162/sdd/f/b/alexis.hernot/securimage/securimage.php:513) in /mnt/162/sdd/f/b/alexis.hernot/securimage/securimage.php on line 1053

    Warning: Cannot modify header information – headers already sent by (output started at /mnt/162/sdd/f/b/alexis.hernot/securimage/securimage.php:513) in /mnt/162/sdd/f/b/alexis.hernot/securimage/securimage.php on line 1054

    Warning: Cannot modify header information – headers already sent by (output started at /mnt/162/sdd/f/b/alexis.hernot/securimage/securimage.php:513) in /mnt/162/sdd/f/b/alexis.hernot/securimage/securimage.php on line 1069
    ‰PNG  ��� IHDR���æ���P���ÿ×à���!PLTEÿÿÿ====== PÌÎÎÎ………mmmUUU¶¶¶æææžžž8CôÝ��`IDAThÅ™KR$7†%Å0”J©TՏq€"fºK-éÓŸJeJ…1S\ŒáƒPŠùÑDc>^å§Èüføxæ',çç0«§™@ÍŒñ`—:ýÛ§²Ù¡¥›1U { Ïr‡Ë;§ý†+6§Ÿ¦Æ¸]fß©X”ÛWÌ7ƒ¡Ëò€‚|TÌMÅ|-Ìd¤ŽÌlþ÷çÂ|+LÀ‡ÂÌ~]— zÎF®˜=™gØ@Ƭ¿àwW‰0}¿Êq³+öšF¥öX2ó­ab}ñâ²ÐA˜2½$³æc«s |'LlP´ûòê«……âLÅĺóPvâe'‡ž1©â[ÅüZ1¿ˆç 3VLªþ3˜÷ÎÀ 3Ël"q­ÓΙaÎCÑ¡âøE3¹¾DE.ÇÐà¸b^kæXL*¦Õ~¡|×z‚pSÙ'Þß×L´­­˜F3§*È í[÷¯w ´Ý¤îc,LÓ·b¾¶Ìq¢^æ4Æ+3+ÍnýÅØ„œÆx‚}‡Ösa,JûOœUó5*›bí Mu'gi™_ :­1­³¸3ÝäKø…Ú¤;€æÅ—h‰ þÍtóN3Ù[�}©˜YwGfàF²mGL@iö3Ãóá`xè¸-Ì1“?þð]¦½æ çZÔ¼ÂLö}¹÷hö2$oŠÇbôT9͘äjWxÒ¢#mI!Ê‚[æ $Ù×3Nf¹Mfâòž×8O~W2‹ÅU%™¯ÀôML0¨ÞCöÌ}ŧ¢âW M3$œ LardØ.óÖwÐ.”¾S•Éû”Õ Á·ãÄWOƒÄè0¥*f» ©ö¼Ã„m1pèA¦ ‹ÌQ2Á•yÎå4ƒÌ—9“…\ÔL½5aÉ!²{/W±SÍŒ*ûŒð@ÑbfsäUÌórv*cž€%烌ZOÍ9#Q`[Ú3à·i}¦×nër.¦Á-´ÚÍ”ebèHG28>O‹æ®¿öJ:ÄJNáøÓ2‡#²,ˆ[sJ‹ä`-g—-9²WåÜuÉ2CaZÜ6âĵ;ò ÍÏóGíŸí… ™eæ ËÔÌãI~4Æ=¢°:2d[E> 0ûVf–©™®0Û@f){ dYä®01Ý\¤oo-óJ˜›,Ó*fTebdZÊtÖäñd2ÓsØ5-³ºpšr+âùóen*¡£œ©1›ef(Ì!µØø­LW1ceè3íÝ÷œ—¥í0iiºL:‡]³i…éäX¬.ÿ©ü{úû?°Md©£ôúNg>‚ plrYfZŸ/’x+b&¿Ã:.̼‘¡Œùâ;Ð+�žYY˜°è5óT1é~áD™—×fÊ êåP¾æÃîPöˆ ó=ç:)©Õƒ0ñÕPYšÞ(ÏQÈ|¿H&­öHP˜æ¯ö-‘§@`åp„9š^ÉYŒ,{O_ivg4õ¢ Ô«W¡ÚJfŠ–}â“tÁèûü€©¡šùPÞ.Þ­½»·Y浡 e°1.õR÷üb¢?â|$﬽O¥­ ß~±¸¥SºE~²åm¼½p…º4ažuàϤ7¿86Çnµ×‘ª’ìJ÷fj[^6÷¡\鶈͋ÓèZ—iúëåÊ„â¶ÈìNe¯«!g'iÖ—yП©¸OA¸>Vd6ŒCþdä4yŽ RUþ“ºÌEa£z†8`9{2e¸ùáxî¥0ãzG-7˜Îf<ÀmIàºïUrÛ–¸-õØ:×vuÕ„öfºÝ8òÿÄ$ÃlæzÌý—3îØ fåºq₩‚Ì]|ÀÑë‚…_ö+qG·K¸%ä!2wꃧ;ÂÞ«v”éâ’ ÷ÞœÑü¬ÌËŸÜ7D³ÊZ����IEND®B`‚
    Warning: Unknown(): open(/mnt/162/sdd/f/b/alexis.hernot/sessions/sess_c5456bcb492df3b0a11d00eb3a158875, O_RDWR) failed: No such file or directory (2) in Unknown on line 0

    Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/mnt/162/sdd/f/b/alexis.hernot/sessions) in Unknown on line 0

    By alexis on Apr 12, 2010

  40. I'm getting these Errors. Please HELP I don't know how to fix theses.

    Warning: Failed to load GD Font file gdfonts/automatic.gdf in /home/content/c/s/p/cspaadmin/html/testsites/limerock/assets/securimage/securimage.php on line 844

    Warning: Cannot modify header information – headers already sent by (output started at /home/content/c/s/p/cspaadmin/html/testsites/limerock/assets/securimage/securimage.php:844) in /home/content/c/s/p/cspaadmin/html/testsites/limerock/assets/securimage/securimage.php on line 1050

    Warning: Cannot modify header information – headers already sent by (output started at /home/content/c/s/p/cspaadmin/html/testsites/limerock/assets/securimage/securimage.php:844) in /home/content/c/s/p/cspaadmin/html/testsites/limerock/assets/securimage/securimage.php on line 1051

    Warning: Cannot modify header information – headers already sent by (output started at /home/content/c/s/p/cspaadmin/html/testsites/limerock/assets/securimage/securimage.php:844) in /home/content/c/s/p/cspaadmin/html/testsites/limerock/assets/securimage/securimage.php on line 1052

    Warning: Cannot modify header information – headers already sent by (output started at /home/content/c/s/p/cspaadmin/html/testsites/limerock/assets/securimage/securimage.php:844) in /home/content/c/s/p/cspaadmin/html/testsites/limerock/assets/securimage/securimage.php on line 1053

    Warning: Cannot modify header information – headers already sent by (output started at /home/content/c/s/p/cspaadmin/html/testsites/limerock/assets/securimage/securimage.php:844) in /home/content/c/s/p/cspaadmin/html/testsites/limerock/assets/securimage/securimage.php on line 1054

    Warning: Cannot modify header information – headers already sent by (output started at /home/content/c/s/p/cspaadmin/html/testsites/limerock/assets/securimage/securimage.php:844) in /home/content/c/s/p/cspaadmin/html/testsites/limerock/assets/securimage/securimage.php on line 1069

    By Joey on Apr 13, 2010

  41. I am using Securimage on two different pages. On one page it works like a champ, but on the other it always says the code entered is incorrect. I checked the FAQ above and saw this can be caused by a nonstandard session name, but if this was the case here I would think that it wouldn't work on either page. Any ideas?

    By Jason on Apr 13, 2010

  42. To those who asked about multiple captchas (hence multiple forms) on one page and how to get it to work….

    put this on your first form just before you call the captcha.

    $newcode=md5(uniqid(time()));

    Now look at that call and remove the echo md5 part and just say echo $newcode instead. This will accomplish the same thing.

    Here's the part you were waiting for. Because we have already issued a unique number ($newcode) we do not need to call that on the next form, otherwise that would be the correct one for both captchas. Just replace the second forms echo md5 with the echo $newcode and your second form will access the same image info. Now they both use the same captcha.

    Now you have two different forms on one page both using captcha.

    Hope this helps!

    By Bill on Apr 14, 2010

  43. Has anyone got this working on zencart? It always says 'The code you entered was incorrect. Go back and try again.'

    Can someone explain how to fix it.

    Thanks

    By James Barr on Apr 19, 2010

  44. I used to make site that saves the session with session_start(); but im saving all the sessions to a MySQL database, with all the data. every time i submit the form it says failed incorrect code because it looks for the code in the database and not in the tmp directory of the server.

    How it this resolved any ideas.
    Best Script ever by the way!

    By Ettienne on Apr 24, 2010

  45. I enabled the sqlite option but still not working.

    By Ettienne on Apr 24, 2010

  46. I spent a lot of time trying to get this to work, but on Firefox and Safari, no dice. Even the example script fails every time when you enter the correct code. Very frustrating. I tried the SQLite and turning on cookies, but that didn't seem to help. Any ideas?

    By Jake on Apr 30, 2010

  47. how can i get a play (audio) button like the one here, or use a different image for the button? is it possible?

    By Jennifer on May 20, 2010

  48. the captcha image i generated using this script quite a few times has overlapping characters.

    how do i reduce that chance?

    By IsenGrim on May 24, 2010

  49. omigod, jquery conflicts with this and messes it up! please fix it

    By kevin on May 25, 2010

  50. how to cahange captcha image

    By bond on May 27, 2010

  51. I'm getting this error in my securimage_show.php file:

    Fatal error: Call to undefined function imagettfbbox() in /services1/webpages/c/v/cvac.ca/public/securimage/securimage.php on line 854

    By Elayner on Jun 7, 2010

  52. Fatal error: Call to undefined function imagettfbbox() in /home2/clixtrem/public_html/DIRECTORY/securimage.php on line 854

    Please help

    Thank You :)

    By Friendi on Jun 7, 2010

  53. Hi Folks!

    I found this issue to be rampant with this most excellent script – unfortunately, I could not find the answer anywhere but I did case it. For the sake of others I've included it here :-)

    "Could not read CAPTCHA cookie. PHP sessions could be broken. Also make sure you have cookies enabled and not blocking in your web browser settings."

    Another important symptom is this – the sound button speaks different letters then appear on the image.

    In my case I'm running IIS 5.0 although the solution should not matter.

    What I found out was that the web service account did not have full access to the sessions directory. (permissions issue)

    In the case of IIS I added the IUSR_MachineName account, and gave it full permissions to the PHP sessions directory (including objects below the directory (child objects).

    As soon as I did this this error disappeared and it also fixed the issue of the sound not being synchronized to the image.

    I know a LOT of people have posted about this very same issue. Whether you are running Linux or Windows the solution should be the same – make certain that whatever account the web services runs under has full permissions to do as it pleases with the PHP session directory.

    Hope this helps case the issue once and for all (other then common browser issues of course).

    Best (and thanks!)
    Marvin Miller

    By Marvin Miller on Jun 9, 2010

  54. I noticed quite a few people having this same issue… hoping someone can help. The captcha appears fine on my form and variables are passed in the URL. However, I get an error saying the text did not match and to try again. My provider has PHP and GD. I tried the FAQ but did not understand naming the session. Any suggestions?

    By C Carr on Jun 11, 2010

  55. I think this form is fantastic – thanks for providing it! I have one small problem which I don't know how to resolve… it's working correctly until the alert is supposed to happen. Instead of displaying the final message in an alert, I get a blank screen with "OK" in the top corner (or if I have filled it in incorrectly, I get the prompts on a blank white screen. For some reason, the line die('OK'); is not talking to the alert. Can anyone suggest what might be happening?

    By Bryn on Jun 12, 2010

  56. text not showing in image solution

    the problem was that sometimes the text on the image was not showing, but it was not the problem with the text transparency or the font not found.
    the problem was that on line 854 the imagettfbbox functino was sometimes returning wired results, for example sometimes the X value which we get few lines below is around 200 and sometimes was like 2423472384 and there is no such pixel for X in the image :)

    so the solution is either to hardcode the position in secureimage.php or to write some checks and modify such big values to some default value

    PHP Version 5.2.6-1+lenny8
    Server version: Apache/2.2.9 (Debian)

    By martin on Jun 14, 2010

  57. I have created mp3 and wav files for albanian language and after clicking play it plays only first letter. Aftermath it is blocked.

    By Ahmet on Jun 19, 2010

  58. Nice script.
    I was getting the failure to open stream error, which just meant the path line wasn't working for me. Instead of the 'include_once $SERVER DOCUMENT_ROOT' etc etc line, try using a relative location instead of the absolute, ie: include("securimage/securimage.php");

    By Steve on Jun 22, 2010

  59. First, great script and easy to implement. Question: is there a way to redirect a user to a page that looks like my website when the wrong code is entered instead of the default error page? Any suggestions would be greatly appreciated. Thanks much… Bruce M.

    By Bruce M. on Jun 26, 2010

  60. Hi I am making the following changes on the Action or "Process form" however its not working. Can anyone advise where it is wrong?

    check($_POST['captcha_code']) == false) {
    // the code was incorrect
    // handle the error accordingly with your other error checking

    // or you can do something really basic like this
    die('The code you entered was incorrect. Go back and try again.');
    }

    $name=$_POST['name'];
    $telephone=$_POST['telephone'];
    $email=$_POST['email'];
    $location=$_POST['location'];
    mysql_connect("db.www.com", "id", "password") or die(mysql_error());
    mysql_select_db("contest") or die(mysql_error());
    mysql_query("INSERT INTO `data` VALUES ('$name', '$telephone', '$email', '$location')");
    Print "Your information has been successfully added to the database.";
    ?>

    By JB on Jun 27, 2010

  61. Hi, These are the changes I am making to my process or action php form, however it is not working. Can anyone point the error? Thank you

    check($_POST['captcha_code']) == false) {
    // the code was incorrect
    // handle the error accordingly with your other error checking
    // or you can do something really basic like this
    die('The code you entered was incorrect. Go back and try again.');
    }
    $name=$_POST['name'];
    $telephone=$_POST['telephone'];
    $email=$_POST['email'];
    $location=$_POST['location'];
    mysql_connect("db.www.com", "id", "password") or die(mysql_error());
    mysql_select_db("contest") or die(mysql_error());
    mysql_query("INSERT INTO `data` VALUES ('$name', '$telephone', '$email', '$location')");
    Print "Your information has been successfully added to the database.";
    ?>

    By JB on Jun 27, 2010

  62. For some reason it did not post the first few lines. Here it is again. I am making the following changes to my process / action form however it does not work

    check($_POST['captcha_code']) == false) {
    // the code was incorrect
    // handle the error accordingly with your other error checking

    // or you can do something really basic like this
    die('The code you entered was incorrect. Go back and try again.');
    }

    $name=$_POST['name'];
    $telephone=$_POST['telephone'];
    $email=$_POST['email'];
    $location=$_POST['location'];
    mysql_connect("db.www.com", "id", "password") or die(mysql_error());
    mysql_select_db("contest") or die(mysql_error());
    mysql_query("INSERT INTO `data` VALUES ('$name', '$telephone', '$email', '$location')");
    Print "Your information has been successfully added to the database.";
    ?>

    By JB on Jun 27, 2010

  63. If you're using PHP Version: 5.3.0+, the Securimage Server Test script, server_test.php, (from the download page) may incorrectly report "JPEG Support: No". This is due to a change in the name of the JPEG Support attribute returned by gd_info(). Prior to 5.3.0, it was 'JPG Support', but it is now 'JPEG Support'. (see http://php.net/manual/en/function.gd-info.php)

    The following change will allow the test script to report the correct value for either version,
    Replace the line:

    With:

    By Davnor on Jul 1, 2010

  64. Oops – let's try that again…

    If you're using PHP Version: 5.3.0+, the Securimage Server Test script, server_test.php, (from the download page) may incorrectly report "JPEG Support: No". This is due to a change in the name of the JPEG Support attribute returned by gd_info(). Prior to 5.3.0, it was 'JPG Support', but it is now 'JPEG Support'. (see http://php.net/manual/en/function.gd-info.php )

    The following change will allow the test script to report the correct value for either version,

    Replace the line:
    <?php print_status($gd_support && $gd_info['JPG Support']); ?>

    With:
    <?php
    if (isset($gd_info['JPEG Support']))
    $JPEG_support = $gd_info['JPEG Support'];
    else
    $JPEG_support = $gd_info['JPG Support'];
    print_status($gd_support && $JPEG_support);
    ?>

    By Davnor on Jul 1, 2010

  65. I got this version of captcha working on a web form for our website with the instructions provided from the quick setup guide.

    We also have a "secure" form (https://) I wanted to put captcha on as well. I can get everything to work great (image shows, reload image and the validation works) except the audio piece. It never wants to read the image. You click on the audio button and it just spins and spins never playing anything.

    Anyone have any thoughts what might causing the audio not to work?

    Thanks

    By Main on Jul 1, 2010

  66. Same as Main: I have everything working perfectly in all browsers except the sound for internet explorer. The sound on this page works find with ie8, but I directly copy the html to mine and the sound does not work (it works for all other browsers).

    By Will on Jul 6, 2010

  67. I should add that this is only a problem for secure https in internet explorer.

    By Will on Jul 6, 2010

  68. Beautiful script – one big issue. Even after checking for the default PHP SESSION name etc, and full path to file in form value and enabling cookies – captcha still fails consistently. Even when entered correctly.

    Am echoing out the Array via print_r($_SESSION) and it is still failing. Is the code value supposed to be equal too the captcha value?

    [securimage_code_value] => vuy28b
    [securimage_code_ctime] => 1278452610

    Any help greatly appreciated.

    By Nelson on Jul 6, 2010

  69. When you call the check() function, are you passing the correct variable containing the user submitted code? i.e. <input type="text" name="code" /> and then you pass $_POST['code']

    By Drew on Jul 9, 2010

  70. Hi I have the same problem as etorre above, in that I want to make a german translation of the audio part of the captcha, but simply recording my own audio files results in only the first letter being read out. Is there a spec for the files? What software were they recorded it at least?

    By Ryan on Jul 14, 2010

  71. OK, here is the spec for MP3 files that work with this flash application:

    channels 1 (mono)
    bit rate 64K
    sample rate 16K
    NO ID3 TAGS!!!!!! (use eyeD3 –remove-all)

    Because of the way that the letter mp3 files are just cat'ed together into a stream… id3 tags in the middle makes the flash player choke.

    A different sample rate also causes inconsistent playback.

    By Ryan on Jul 14, 2010

  72. I have just installed, unfortunately it did not work the image did not show. I checked the properties of the missing image the sid was missing this was also the same when I tried the example_code.

    Any ideas!!!

    By Stephen on Jul 26, 2010

Post a Question

CAPTCHA Image
Reload Image
Enter Code Below