Hi there!
I'm developing my website with BlueVoda, and I added a "contact form" with a Thankyou.php page:
So, my contact form & Thankyou page work perfectly, I receive the feedback from my visitors... the problem (there's always one, huh?) is that I need to "validate" the form, that is to say, to have a little piece of code able to check the three fields (name, email, comments) before sending me an empty email, to prevent what now happens: email account collapsed with empty emails...
I've tried to validate it through javascript, in the same page of the form, "contact.html", but it doesn't work... as soon as I click to send the form (through Thankyou.php, as action="Thankyou.php" and method="post"), the thankyou page processes an empty email to my account...
And I know nothing about php scripting, so I should not "touch" any code provided by BlueVoda & Forum Members working as is...
Can anyone help me, please...? I just need to stop empty emails collapsing my account with the same structure I have now (no more pages):
+ Contact.html (contains the basic form and sends it to process it through Thankyou.php)
+ Thankyou.php (contains the php code provided below and a Thank You message)
<?PHP
$email = $HTTP_POST_VARS[email];
$mailto = "myemail@mydomain.com";
$mailsubj = "Envío de Formulario de Contacto";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Valores enviados desde el formulario de contacto :\n";
while (list ($key, $val) = each ($HTTP_POST_VARS))
{
if ($key!="submit")
{
$mailbody .= "$key : $val\n";
}
}
mail($mailto, $mailsubj, $mailbody, $mailhead);
?>
Thank you in advance and, please, forgive my english, I'm not an english native speaker!
I'm developing my website with BlueVoda, and I added a "contact form" with a Thankyou.php page:
So, my contact form & Thankyou page work perfectly, I receive the feedback from my visitors... the problem (there's always one, huh?) is that I need to "validate" the form, that is to say, to have a little piece of code able to check the three fields (name, email, comments) before sending me an empty email, to prevent what now happens: email account collapsed with empty emails...
I've tried to validate it through javascript, in the same page of the form, "contact.html", but it doesn't work... as soon as I click to send the form (through Thankyou.php, as action="Thankyou.php" and method="post"), the thankyou page processes an empty email to my account...
And I know nothing about php scripting, so I should not "touch" any code provided by BlueVoda & Forum Members working as is...
Can anyone help me, please...? I just need to stop empty emails collapsing my account with the same structure I have now (no more pages):
+ Contact.html (contains the basic form and sends it to process it through Thankyou.php)
+ Thankyou.php (contains the php code provided below and a Thank You message)
<?PHP
$email = $HTTP_POST_VARS[email];
$mailto = "myemail@mydomain.com";
$mailsubj = "Envío de Formulario de Contacto";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Valores enviados desde el formulario de contacto :\n";
while (list ($key, $val) = each ($HTTP_POST_VARS))
{
if ($key!="submit")
{
$mailbody .= "$key : $val\n";
}
}
mail($mailto, $mailsubj, $mailbody, $mailhead);
?>
Thank you in advance and, please, forgive my english, I'm not an english native speaker!
Comment