Jump to content

replace array in select of s3Captcha jquery plugin


whynot

Recommended Posts

I found s3captcha captcha jquery plugin. this worked perfectly but i have a problem. my project not in english language and in this plugin images set with english Prefix. in act fruit images ( apple.jpg ,lemon.jpg etc... ) or general images ( rss.jpg , folder.jpg etc ... ) and for captcha message u see this : Verify that you are a human, please choose folder , apple (EXT NAME OF JPG). now if i change message i need to change Prefix images. this not worked because my language not support images prefix. so i need to replace prefix name images to my language . e.x: please select hoş . hoş = apple or çıkan = folder in images. There is a way? thanks For Any Help.

 

setup plugin :

$values = array('apple','strawberry','lemon','cherry','pear'); // image names //
$imageExt = 'jpg'; // images extension //
$imagePath = 's3images/'; // images path //
$imageW = '33'; // icon width //
$imageH = '33'; // icon height //

 

Desc of owner : ( my problem )

Please note that the way you name your image, is the same name that will be shown at the front end where scipt ask you to select that image.

 

 

HTML :

 

<form name="demo" action="verify.php" method="post">
<div id="capcha"> <?php include("s3Capcha.php"); ?> </div><br /><br /><br />
<input type="submit" value="Submit" />
</form>

s3captcha.php :

 

<?php
session_start();
include("s3Config.php");
$rand       = mt_rand(0,(sizeof($values)-1));
shuffle($values);
$s3Capcha = '<p>Verify that you are a human, please choose <strong>'.$values[$rand]."</strong></p>\n";
for($i=0;$i<sizeof($values);$i++) {
$value2[$i] = mt_rand();
$s3Capcha .= '<div><span>'.$values[$i].' <input type="radio" name="s3capcha" value="'.$value2[$i].'"></span><div style="background: url('.$imagePath.$values[$i].'.'.$imageExt.') bottom left no-repeat; width:'.$imageW.'px; height:'.$imageH.'px;cursor:pointer;display:none;" class="img" /></div></div>'."\n";
}
$_SESSION['s3capcha'] = $value2[$rand];
echo $s3Capcha;
?>

THANKS

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.