|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi all,
This is my first post on this community . I just start to learn and use PEAR's library, and I'm very excited to continue with it ! I Start to learn with a simple form, and I try to put captcha's package on it. So I install on /pear : HTML_Common-1.2.4 HTML_QuickForm-3.2.9 HTML_QuickForm_CAPTCHA-0.2.1 Text_CAPTCHA-0.3.0 Text_CAPTCHA_Numeral-1.2.0 Image_Text-0.6.0beta And I still can't see pictures and caracters on it. I already copy arial.ttf in my Pear/QuickForm folder. [edit] this is the code on the output html picture : Code:
/qfcaptcha_image.php?var=index don't it need an extension jpeg or png ?? [/edit] Does anybody have ideas ?? Thanks ;) Padaben Ps : Sorry for my english ! Last edited by padaben : August 20th, 2007 at 09:17 AM. |
|
#2
|
|||
|
|||
|
Hi !
This is the php code I use in my index.php where I've got the form.
Code:
<?php
set_include_path(get_include_path() . ";C:\wamp\php\PEAR");
require_once "HTML/QuickForm.php";
require_once 'HTML/QuickForm/CAPTCHA.php';
require_once 'HTML/QuickForm/CAPTCHA/Image.php';
session_start();
$form = new HTML_QuickForm('AngeNL', 'post');
$form->addElement('text', 'Email', 'e-mail : ');
$options = array(
'width' => 250,
'height' => 90,
'callback' => 'qfcaptcha_image.php?var='.basename(__FILE__, '.php'),
'sessionVar' => basename(__FILE__, '.php'),
'imageOptions' => array(
'font_size' => 20,
'font_path' => 'C:/wamp/php/PEAR/HTML/QuickForm/',
'font_file' => 'arial.TTF'),
'output' => 'png',
);
$captcha_question =& $form->addElement('CAPTCHA_Image', 'captcha_question',
'<br />Verification : ', $options);
if (PEAR::isError($captcha_question))
{
echo $captcha_question->getMessage();
exit;
}
$form->addElement('static', null, null, 'initialize code');
$form->addElement('text', 'captcha', 'enter validation code : ');
$form->addRule('captcha', 'Text code captcha',
'required', null, 'client');
$form->addRule('captcha', 'Code doesn\'t match',
'CAPTCHA', $captcha_question);
$form->addElement('submit', '', 'Verify');
if ($form->validate())
{
$captcha_question->destroy();
$form->process('functionAffich', false);
}
else
{
$form->display();
}
?>
In 'output' entry in the $options array I add png or jpeg, but it didn't change. In fact I don't understand why I've got the instance of the element contruction twice. In the CAPTCHA/image.php and in my code. !!! Not easy for me Thanks for your help Padaben |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PEAR Packages > QuickForm Captcha without image !! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|