Hi all,
Im trying too use swiftmailer in my project for processing webforms. So far so good! I got the core of it working, when i fill the form it will be processed and send to my mailadress. The only problem I have now is displaying the errors. I need to integrate the following code into page where the form is.
<?php
//Show errors
if (!empty($_GET["error"]))
{
switch ($_GET["error"])
{
case "reguired_fields": ?>
<div class="form-error">Fill in all fields!</div><?php
break;
case "invalid_email": ?>
<div class="form-error">Invalid e-mail!</div><?php
break;
case "verzenden_mislukt": ?>
<div class="form-error">System error, please try later!</div><?php
break;
case "link_spam": ?>
<div class="form-error">Forbidden to send Link spam!.</div><?php
break;
}
}
if (!empty($_GET["succes"]))
{
switch ($_GET["succes"])
{
case "form_footer": ?>
<div class="form-proces">The form data has been send!</div>
<?php session_destroy(); ?>
<?php
break;
}
}
?>
I hope someone has some kind of solution here. I think that the html above need to be put into an chunk. Then calling those chunks into the snippet white the above php code. Only i can’t get that working.