Author Topic: Mail Contact Form  (Read 1468 times)

0 Members and 1 Guest are viewing this topic.

Offline Pianjy

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Mail Contact Form
« on: September 07, 2010, 06:58:39 AM »
Hi all!

I want to use JEZ Recaptcha with a mail contact form in our Joomla Instalation (1.5.15)

I think I've tried all the possibilities:
   - Using Inclusion Syntax with {captcha}
   - Not Using It with:                         global $mainframe;
                                            $mainframe->triggerEvent('onCaptchaDisplay');

I put the code between <form>....</form>  and between <?php         ?>

Recaptcha isn't showed in the page... The only I can see is:

"Fatal error: Call to a member function triggerEvent() on a non-object in /var/www/company/formulario.php on line 66"

this is the Line 66 of Formulario.php:
Code: [Select]
62.     <div align="left" style="">

64.     <?php
65.     global $mainframe;
66.     $mainframe->triggerEvent('onCaptchaDisplay');
67.     ?>


69.    <input type="submit" name="bEnviar" value="Enviar" style="margin-                   left:190px; border:none; background:#FFFFFF; font-weight:bolder;   font-family:arial;">
     70. <input type="reset" name="bReset" value="Reset" style="border:none; background:#FFFFFF; font-weight:bolder; font-family:arial;">
</div>
</form>

Can anyOne help me??

Thanks in advance;

Edited: Atacched a screen-shot of the error message.


« Last Edit: September 07, 2010, 07:18:25 AM by Pianjy »

Offline BDD

  • Global Moderator
  • Full Member
  • *****
  • Posts: 146
  • Karma: +0/-0
    • View Profile
Re: Mail Contact Form
« Reply #1 on: September 07, 2010, 09:22:23 PM »
Hello,

Does your formulario.php file wrapped by Joomla framework or accessed directly via web URL?

Offline Pianjy

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Mail Contact Form
« Reply #2 on: September 08, 2010, 10:51:44 AM »
Hi Again!

And thanks for your reply.

Formulario.php is embebed using the type emmbebed url(wrapper) for a Menu item. And is the content of the Iframe created.

It's ok?

Offline BDD

  • Global Moderator
  • Full Member
  • *****
  • Posts: 146
  • Karma: +0/-0
    • View Profile
Re: Mail Contact Form
« Reply #3 on: September 08, 2010, 10:13:07 PM »
Formulario.php is embebed using the type emmbebed url(wrapper) for a Menu item. And is the content of the Iframe created.

That's why our plugin fail to work. Please note that our plugin only working properly with content generated by Joomla (inclusion syntax) and when embedded inside a PHP file that wrapped by Joomla framework (triggerEvent method), e.g. a PHP file that is part of a Joomla component or module.

In your case, the contact form is generated by a stand-alone script (formulario.php) which causes our plugin fail to work. Why dont you use the built-in contact component of Joomla?
« Last Edit: September 09, 2010, 09:45:09 PM by BDD »

Offline Pianjy

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Mail Contact Form
« Reply #4 on: September 09, 2010, 05:41:46 AM »
XD !! I have tried it.
I have change the code from formulario.php, to a new module. Now I can see the recaptcha block in my site.

I'm using inclusion Syntax and Auto-verify, but recapcha seems not to do nothing.
Verification doesn't occurs...

had I forgotten something?

Thanks again!

Offline BDD

  • Global Moderator
  • Full Member
  • *****
  • Posts: 146
  • Karma: +0/-0
    • View Profile
Re: Mail Contact Form
« Reply #5 on: September 09, 2010, 05:48:55 AM »
Did you actually place the inclusion syntax inside a form?

Offline Pianjy

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Mail Contact Form
« Reply #6 on: September 09, 2010, 06:34:38 AM »
 Yes, I did.

I have {captcha} between the labels <form>....</form>
and recaptcha box is shown in the web page, but if I don´t type any word on it, it works too.

¿Have I to modify the action atribute in the form??

       <form action="/sendmail.php" method="post" style="font-family:Arial; font-size:12px;">

Offline BDD

  • Global Moderator
  • Full Member
  • *****
  • Posts: 146
  • Karma: +0/-0
    • View Profile
Re: Mail Contact Form
« Reply #7 on: September 09, 2010, 09:43:40 PM »
       <form action="/sendmail.php" method="post" style="font-family:Arial; font-size:12px;">

As i know, Joomla never submit any form to an individual PHP file, instead all form submission will go thru Joomla's index.php file to be routed to appropriated component for processing.

If your sendmail.php file is a stand-alone script running outside of Joomla framework then, properly, our plugin cannot verify the captcha input.

Why dont you use the built-in contact component of Joomla?

 

This is not an official Joomla! Site. The use of the words Joomla is intended to describe what the products are designed for and should not be considered an endorsement by the related Projects.