[Solved] PHP Email Validation Cache issue

zendiko 01 Dec, 2008
Hey guys,

Just installed this Component and Module and I have to say that it is AWESOME! Saves a lot of time!

Anyway... on to my issue...

I have a form and I added some php server side validation in the box:

<?php 
function is_valid_email($sender_mail) { 
    if(ereg("([[:alnum:]\.\-]+)(\@[[:alnum:]\.\-]+\.+)", $sender_mail)) {
		return 0;
    }
	else{
        return 1;
    } 
}
$emailvalid = is_valid_email($_POST['email']);
if($_POST['name'] == '')
return 'Please enter your name';
if($_POST['email'] == '' || $emailvalid == 1)
return 'Please enter a valid email address';
?>


The validation works great, however after the user successfully meets all requirements and submits the form it goes to a page saying "thanks for submitting... blah blah..."... however when they go back to the url that the contact form is on, it still shows the last error that the user encountered before the successful submission... almost like it is caching and not updating on the submission.

Is it my code?

The live form can be found here: http://clients.zendiko.com/toss/bo/index.php/contact-us

Any help would be appreciated!

Thanks!

Aaron
Max_admin 01 Dec, 2008
Hi Aaron,

this is a bug, in chronocontact.php find :

if ($returnval = eval( "?>".$rows[0]->server_validation )){

add just below it:
JRequest::setVar('cf_wrong_security_code', 1);


then in chronocontact.html.php, find:

<style type="text/css">
		span.cf_alert {


edit the line before it to be:

<?php if(($session->get('chrono_verification_msg', '', md5('chrono')))&&(JRequest::getVar('cf_wrong_security_code') == 1)){ ?>


let me know!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
zendiko 01 Dec, 2008
Thanks Max!

I will try it and let you know if I have any more problems!

Aaron
zendiko 02 Dec, 2008
Max,

I edited exactly what you said and the problem still exists.

Aaron
Max_admin 02 Dec, 2008
Hi Aaron,

sorry but I just tried it here and its working flawlessly, please make sure changes are made correctly as I pointed!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
zendiko 02 Dec, 2008
When you said:

this is a bug, in chronocontact.php find :

if ($returnval = eval( "?>".$rows[0]->server_validation )){

add just below it:
JRequest::setVar('cf_wrong_security_code', 1);


then in chronocontact.html.php, find:

<style type="text/css">
		span.cf_alert {



Did you mean Add that code underneath the first code? Cuz that's what I did.

Aaron
zendiko 02 Dec, 2008
I just purchased the license... does the new code you sent me have this issue fixed in it?

Aaron
Max_admin 02 Dec, 2008
Hi Aaron,

the license email has patches only, not with any new fixes because the fix depends on many files.

just follow my directions at this post:
http://chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&t=11789#pr18365

you need to edit 2 files, one line to insert at each of them, pay attention that the 2nd file will need the line inserted before the line I mention and not after it, its to be edited too and not just an insert, let me know how you go with this and if you can't do it then I will send you a patch for the 2nd file only, you need to make the first file change.

make sure you save files after edits.

regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
zendiko 02 Dec, 2008
It appears that the changes have taken place but because I am using the module, the changes are still present as well as the backlink... if i visit the direct link to the form it is fixed, but it is displayed through the module plugin on my site.

Aaron
zendiko 02 Dec, 2008
When I downloaded Chronoforms, I just installed the main v3 and the module to display the forms in modules. I never downloaded the mambot and honestly... I've never used mambots and have no idea what they are.

I performed the change that Max told me to do for the email trapping... it was successful when you go into the Chronoform main page in the admin and click the direct link to the form... but when the forms are displayed through the module, they are not taking the change or dropping the backlink... I don't get it... is something cached somewhere? Because the files are changed!!!

I have attached 2 photos... the first is when I go to the Contact Us page which is where I am pulling that form onto that page through the module plugin. **notice the backlink still there... and the error traps get stuck**

The second is a picture of the form when I click the direct link in the Forms Management Window. **Notice no backlink... and the error traps are fixed**
Max_admin 02 Dec, 2008
Hi zendiko,

it seems the mod file got missed from the license email, I just resent it with the mod patch!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
zendiko 02 Dec, 2008
OK this issue is closed... I had to add one of the patches to this mod file to fix the error issue.

It's all set now.

Thanks!

Aaron
This topic is locked and no more replies can be posted.