Phpcaptcha

I want to use phpcaptcha. when I use below, audio works fine:

    <object type="application/x-shockwave-flash" 
data="securimage_play.swf?bgcol=#ffffff&amp;icon_file=images/audio_icon.png&amp;audio_file=securimage_play.php" 
height="32" width="32">
    <param name="movie" 
value="securimage_play.swf?bgcol=#ffffff&amp;icon_file=images/audio_icon.png&amp;audio_file=securimage_play.php" />
    </object>

but if I want to move phpcaptcha to /captcha/ folder and use it from root, I changed it to:

&lt;object type="application/x-shockwave-flash" data="[B][COLOR="#FF0000"]captcha/[/COLOR][/B]securimage_play.swf?bgcol=#ffffff&amp;icon_file=[B][COLOR="#FF0000"]captcha/[/COLOR][/B]images/audio_icon.png&amp;audio_file=[B][COLOR="#FF0000"]captcha/[/COLOR][/B]securimage_play.php" height="32" width="32"&gt;
&lt;param name="movie" value="[B][COLOR="#FF0000"]captcha/[/COLOR][/B]securimage_play.swf?bgcol=#ffffff&amp;icon_file=[B][COLOR="#FF0000"]captcha/[/COLOR][/B]images/audio_icon.png&amp;audio_file=[B][COLOR="#FF0000"]captcha/[/COLOR][/B]securimage_play.php" /&gt;
&lt;/object&gt;

However the flash is loaded,I assume the path is correct but it doesn’t read the audio anymore on IE nor on Android but still works on FF. please advice what wrong I did?

Did you try the full URI?

...audio_file=http://www.site.com/.../captcha/securimage_play.php...

I tried this too, nothing help. any other idea?
PS. Thanks to Mittineague for editing my original post.

Off Topic:

No problemo

Going by http://helpx.adobe.com/flash/kb/object-tag-syntax-flash-professional.html it seems the path can be a few variations

The SWF file path can be relative to the location of your HTML file or the fully qualified, absolute path of your SWF file. For example:

If the SWF file is in the same folder as the HTML file, you only need the filename of the SWF file.
If the SWF file is in a subfolder, the path is something like "subfolder_name/movie_name.swf" (without the quotes).
If the SWF file isn't in the folder with the HTML file, use "../" for each level up from the folder with the HTML file. (Don't include the quotes in the syntax.) So "../../../separate_folder/movie_name.swf" goes up three levels from the folder with the HTML file before going down into the "separate_folder" to find the SWF file.
A fully qualified path is the same thing as a complete URL (that is, http://www.myDomain.com/flash_content/movie_name.swf.)

So the problem is with the GET vars?

This swf file is actually the speaker icon and as ai said it is working fine. The problem is with wav files that i don’t heat any more if i call the player file localted in captcha folder from root. As icon is showing fine ai asdume i defined a correct path and am wondering why it will not work anymore on IE nor on Android but still working fine on FF. Any idea?

My guess is that one of the files needs the additional files to be in the same directory it’s in and / or doesn’t accept the same path syntax.

That is, if everything worked when everything was in the same folder but some things are now broke, it’s probably a path issue.

Sorry, but I have never used GET vars in either object data or param value values, so I’m only “debugging remotely”’

Of the four:
captcha/securimage_play.swf
bgcol=#ffffff
icon_file=captcha/images/audio_icon.png
audio_file=captcha/securimage_play.php

They all work in Firefox, but not in others, correct

So any idea how to fix it? I see there is an option to define audio files path as /audio/en
I think something like:
$img->audio_file = $img->securimage_path . ‘/audio/en’;
Or something like that if you investigate config area you’ll find it. Can you test it too?

I’m guessing you mean the same code. Have you tried debugging? http://www.phpcaptcha.org/documentation/debugging-problems/

To debug issues with Securimage: the first thing to do is to set PHP’s error_reporting and display_errors options so that errors will be visible in the browser window. The 3rd line of securimage.php will set these options for you, but first the line needs to be uncommented. Open securimage.php and find the third line that looks like:
1 // error_reporting(E_ALL); ini_set(‘display_errors’, 1); // uncomment this line for debugging

To uncomment this line, remove the two // characters from the beginning of the line and save the file. Now all Securimage will cause error messages and warnings to be output to the browser. Now depending on your problem, you should see error messages display.

If the captcha image is not loading, try accessing securimage_show.php directly in your browser. You should see something similar to:
Debugging Errors

Example Debug Output

This error message in particular is saying that the SQLite database file is not writeable by the webserver and its permissions need to be changed in order to function properly.

If you are having trouble with playing the audio files, open securimage_play.php directly in your browser and check the output, or if the browser prompts you to save the file, open the resulting WAV file in a text editor to see if any error messages are contained in the output.

If the problem occurs during validation, try to validate your form and see if any error messages are displayed.

Check the FAQ for causes and solutions to common issues if the error message isn’t enough to solve the problem. Once the issues have been resolved, you should comment line 3 of securimage.php again by re-adding the // at the beginning of the line.

If you still can’t solve the problem, you may post a comment or use the contact form to provide as much detail about your problem, and we can attempt to help you resolve the issue

This debugging is for php errors, if there was php error it should not work even on FFF. But works fine. Anyway i tried direct accessing to player file and it enforces browser to download a .wav file and the audio file works fine to read a letter. Any more idea?

My guess is that the path to the file is OK
captcha/securimage_play.swf

But that file then looks for the files passed to it as GET vars not from the page’s location but relative to the location it’s in. i.e.
captcha/captcha/images/audio_icon.png
captcha/captcha/securimage_play.php

I’m a bit surprised that absolute paths with the http:// didn’t work.

But I think if you try variations of with and without the “captcha/” portion you should be able to feed it what it wants.
I’d start by leaving it in the path for what is working and removing it from those that aren’t

Any success how to fix it?

Instead of doing my own i love to do have recaptach in my website which take care of all the technical difficulty for me.

For some reasons i cannit use recaptcha and I prefer to solve my issue with phpcaptcha. Any idea how to solve it?
Mittineague, any success to figure it out?

Well, I don’t know. What various combinations have you tried?

I tried to remove /captcha/ from player path from both object and param. No success. What did you do? Any idea?

Any success yet mittineague?

I haven’t tried this on my localhost, but I did take a look at documentation and some code.

http://www.phpcaptcha.org/documentation/flash-audio-code/

http://www.phpcaptcha.org/documentation/flash-audio-code/

Check that you are using 3.2RC2 or greater, as the icon_file parameter was not supported before that. For best results, the image should be stored on the same server as the captcha image, and you may need to specify a full, encoded URL (e.g. http%3a%2f%2fyoursite.com%2fimages%2faudio_icon.png). Encoding may be optional in some browsers but for the greatest compatibility you should URLEncode the path. JPEG, Transparent PNG, and GIF images are supported.

The example here looks different from any example code you’ve shown https://github.com/dapphp/securimage/blob/master/captcha.html

  <!-- The following is example HTML that can be used on your form -->

  <p>
    <img id="siimage" style="border: 1px solid #000; margin-right: 15px" src="./securimage_show.php?sid=<?php echo md5(uniqid()) ?>" alt="CAPTCHA Image" align="left">
    <object type="application/x-shockwave-flash" data="./securimage_play.swf?bgcol=#ffffff&amp;icon_file=./images/audio_icon.png&amp;audio_file=./securimage_play.php" height="32" width="32">
    <param name="movie" value="./securimage_play.swf?bgcol=#ffffff&amp;icon_file=./images/audio_icon.png&amp;audio_file=./securimage_play.php" />
    </object>
    &nbsp;
    <a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false"><img src="./images/refresh.png" alt="Reload Image" onclick="this.blur()" align="bottom" border="0"></a><br />
    <strong>Enter Code*:</strong><br />
    <input type="text" name="ct_captcha" size="12" maxlength="16" />
  </p>  

*note that the paths begin with “./”