PEAR Packages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPEAR Packages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old August 20th, 2007, 09:05 AM
padaben padaben is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Posts: 2 padaben User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 46 m 54 sec
Reputation Power: 0
Question QuickForm Captcha without image !!

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.

Reply With Quote
  #2  
Old August 20th, 2007, 09:27 AM
padaben padaben is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Aug 2007
Posts: 2 padaben User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 46 m 54 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPEAR Packages > QuickForm Captcha without image !!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway