LiveValidationPHP

HI guys (:

Having a little trouble with a form, just wondering if anyone could help me out?

It’s based on something called LiveValidationPHP (I’d post a link but you have to have at least 10 posts…). The validation is no problem at all, I have that all set up and working. The problem is I can’t seem to send the information to an email once it’s been validated.

Frontend code

[php]

<?php include("scripts/livevalidationphp.class.php"); // the LiveValidationPHP scripts include("scripts/rules.inc.php"); // hold the rules $html=""; $frmTestLive=new LiveValidationMassValidatePHP("frmTest",$_POST); $frmTestLive->addRules($formRules["frmTest"]); $html=$frmTestLive->generateAll(); // check for a post action $frmTestErrors=array(); if(isSet($_POST["action"])) { if($_POST["action"]=="send_test_form") { $frmTestErrors=$frmTestLive->validate(); } } ?> [/php]

Backend code

Again, can’t post links and it woulsn’t let me post the full code…

I understand the information is being processed here if the form is valid:

[php]
if(isSet($_POST[“action”]))
{
if($_POST[“action”]==“send_test_form”)
{
$frmTestErrors=$frmTestLive->validate();
}
}
[/php]

But I’ve looked for the validate(); fuction in the backend code and I honestly can’t figure out how to send the information from the form…

Does anyone know where in the code It’s suppose to be sending this? I’m used to very simple forms, this one is quite complex in comparison and I’m a bit lost to be fair.

Thanks for any help (:

Jenni,

I don’t see anywhere in the code that you posted that sends an email. Normally, you will see a mail function or a sendmail function. I don’t see that anywhere…

Perhaps you’re missing a piece of code someplace.

Cheers for the reply.

To be honest I’m not sure there’s one included. I think this mainly focuses on the validation.

Is there anyway to tell this to run a mail function when the forms marked as valid?

[php]
if(isSet($_POST[“action”]))
{
if($_POST[“action”]==“send_test_form”)
{
$frmTestErrors=$frmTestLive->validate();
echo “Form is valid”;
}
}
[/php]

This echos correctly when it’s valid, so I know it’s working. I’ve checked the W3Schools to try and figure out how to add one but really can’t see how to link it into this PHP. Even getting this to maybe echo the form data would be a start. Any ideas?

It’s pretty easy…

http://www.phphelp.com/php_tutorial/using-php-to-generate-and-send-mail.html

Sponsor our Newsletter | Privacy Policy | Terms of Service