nimasdj — 2014-04-13T15:48:56-04:00 — #1
I want to use phpcaptcha. when I use below, audio works fine:
but if I want to move phpcaptcha to /captcha/ folder and use it from root, I changed it to:
<object type="application/x-shockwave-flash" data="[B]<font color='"#FF0000"'>captcha/</font>[/B]securimage_play.swf?bgcol=#ffffff&icon_file=[B]<font color='"#FF0000"'>captcha/</font>[/B]images/audio_icon.png&audio_file=[B]<font color='"#FF0000"'>captcha/</font>[/B]securimage_play.php" height="32" width="32">
<param name="movie" value="[B]<font color='"#FF0000"'>captcha/</font>[/B]securimage_play.swf?bgcol=#ffffff&icon_file=[B]<font color='"#FF0000"'>captcha/</font>[/B]images/audio_icon.png&audio_file=[B]<font color='"#FF0000"'>captcha/</font>[/B]securimage_play.php" />
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?
vectorialpx — 2014-04-14T03:04:37-04:00 — #2
Did you try the full URI?
nimasdj — 2014-04-14T16:32:57-04:00 — #3
I tried this too, nothing help. any other idea?
PS. Thanks to Mittineague for editing my original post.
mittineague — 2014-04-14T16:53:32-04:00 — #4
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?
nimasdj — 2014-04-14T17:04:22-04:00 — #5
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?
mittineague — 2014-04-14T17:34:03-04:00 — #6
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:
They all work in Firefox, but not in others, correct
nimasdj — 2014-04-14T17:56:21-04:00 — #7
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?
mittineague — 2014-04-14T19:46:20-04:00 — #8
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:
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
nimasdj — 2014-04-16T08:26:48-04:00 — #9
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?
mittineague — 2014-04-16T13:31:54-04:00 — #10
My guess is that the path to the file is OK
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.
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
nimasdj — 2014-04-16T16:25:18-04:00 — #11
Any success how to fix it?
victoriamon — 2014-04-16T16:59:41-04:00 — #12
Instead of doing my own i love to do have recaptach in my website which take care of all the technical difficulty for me.
nimasdj — 2014-04-17T04:05:12-04:00 — #13
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?
mittineague — 2014-04-17T04:12:56-04:00 — #14
Well, I don't know. What various combinations have you tried?
nimasdj — 2014-04-17T07:00:39-04:00 — #15
I tried to remove /captcha/ from player path from both object and param. No success. What did you do? Any idea?
nimasdj — 2014-04-26T05:02:01-04:00 — #16
Any success yet mittineague?
mittineague — 2014-04-26T19:04:25-04:00 — #17
I haven't tried this on my localhost, but I did take a look at documentation and some 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 -->
<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&icon_file=./images/audio_icon.png&audio_file=./securimage_play.php" height="32" width="32">
<param name="movie" value="./securimage_play.swf?bgcol=#ffffff&icon_file=./images/audio_icon.png&audio_file=./securimage_play.php" />
<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" />
*note that the paths begin with "./"