close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

I have a question on Captcha. I would like to change the font color of the random questions that are asked to white? I would like to know what code to write and where to place it.

Thread began 10/12/2013 7:10 pm by anonymous | Last modified 10/14/2013 9:32 am by anonymous | 1249 views | 2 replies |

anonymous

I have a question on Captcha. I would like to change the font color of the random questions that are asked to white? I would like to know what code to write and where to place it.

Here is the code:

<?PHP

class FGSimpleCaptcha extends FG_CaptchaHandler
{
var $error_str;
var $captcha_varname;
var $uniquekey;

function FGSimpleCaptcha($captcha_var_name)
{
$this->captcha_varname=$captcha_var_name;
$this->uniquekey='KHJhsjsy65HGbsmnd';
}

/*Add more simple questions here.*/
function GetSimpleCaptcha()
{
$arrQuestions = array(
"What color is the sky?"=>"blue",
"What is 1+1?" => "2",
"What is the color of grass?"=>"green",
"Are you a robot?"=>"no",
"Are you human?"=>"yes");

$question = array_rand($arrQuestions);
$answer = $arrQuestions[$question];

$_SESSION['FGCF_Captcha_Answer'] = $this->Md5CaptchaAnswer($answer);

return $question;
}

function SetFormKey($key)
{
$this->uniquekey = $key;
}
function GetKey()
{
return $this->uniquekey;
}
function Validate()
{
$ret=false;
if(empty($_POST[$this->captcha_varname]))
{
$this->error_str = "Please answer the anti-spam question";
$ret = false;
}
else
{

$scaptcha = trim($_POST[$this->captcha_varname]);

$scaptcha = strtolower($scaptcha);

$user_answer = $this->Md5CaptchaAnswer($scaptcha);

if($user_answer != $_SESSION['FGCF_Captcha_Answer'])
{
$this->error_str = "Failed the anti-spam check!";
$ret = false;
}
else
{
$ret = true;
}
}//else
return $ret;
}
function Md5CaptchaAnswer($answer)
{
return md5($this->GetKey().$answer);
}
function GetError()
{
return $this->error_str;
}
}
?>

Sign in to reply to this post

Jason ByrnesWebAssist

you would change the font color of the random questions by using CSS on the page where the random question is displayed.


<span style="color: red;"><display random question></span>

Sign in to reply to this post

anonymous

Thanks, Jason! Worked like a charm. Sometimes the solution turns out to be easier than first perceived.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...