| 1 |
<? |
<? |
| 2 |
|
|
| 3 |
function _captcha_image_challenge(&$form) { |
function _captcha_image_challenge(&$form) { |
|
|
|
|
$form['captcha_image'] = array ( |
|
|
'#type' => 'item', |
|
|
'#title' => 'captcha image', |
|
|
'#weight' => 0, |
|
|
'#value' => '<img src="' . url('captcha/image/'.time()) . '" alt="Captcha Image: you will need to recognize the text in it."/>', |
|
|
); |
|
|
|
|
| 4 |
$form['captcha_response'] = array ( |
$form['captcha_response'] = array ( |
| 5 |
'#type' => 'textfield', |
'#type' => 'textfield', |
| 6 |
'#title' => t('Word'), |
'#title' => t('Captcha Validation'), |
| 7 |
'#defaultvalue' => '', |
'#defaultvalue' => '', |
|
'#weight' => 0, |
|
| 8 |
'#required' => TRUE, |
'#required' => TRUE, |
| 9 |
'#validate' => array('_captcha_validate' => array()), |
'#validate' => array('_captcha_validate' => array()), |
| 10 |
'#description' => t('Please type in the letters/numbers that are shown in the image above.') |
'#description' => t('Please type in the letters/numbers that are shown in the image above.'), |
| 11 |
|
'#prefix' => '<img src="' . url('captcha/image/'.time()) . '" alt="Captcha Image: you will need to recognize the text in it."/>', |
| 12 |
); |
); |
| 13 |
|
|
| 14 |
return $form; |
return $form; |