Mail Form receiving emails with no content
Posted on
16th Feb 2014 07:03 pm by
admin
Hi, I hope someone here can help me.
I have a simple form in my website, it was working OK, after lots of trouble finding out how to make this form I managed to make it work.
I had to create an .htaccess file in the server with some lines inside and that prevented the email to come up with blank fields (meaning only the names of the fields came up in the received email, but with no info inside).
The thing is that this .htaccess file is not anymore in the server............. (i think that one of my partners erased it but he wont admit it!!!!!!!hahah)
and I never backed up this file...my misteka.... Now, i can't find the forum where I got the info on what I should put inside this file, i've been searching on google for two hours now and tried everything I found but nothing seems to work!
Could you please tell me what I should put in this .htaccess file in order to stop receiving emails with no info in the fields???
thanks a lot!!!
here is my code:
<form id="form" name="form" method="post" action="/PHP/noticia01.php">
Nombre:
<input name="nombre" type="text" id="nombre" />
Email:
<input name="email" type="text" id="email" />
Comentarios:
<textarea name="comentarios" cols="30" rows="3" id="comentarios"></textarea>
<input name="submit" type="submit" id="submit" value="Enviar!" />
</form>
--------------------------------
THE PHP FILE IS THE FOLLOWING
<?php
if (isset($_POST['submit'])) {
// We get all the variables
foreach ($_POST as $key=>$value) {
if ( gettype( $value ) == "array" ) {
//print "$key ==
n";
} else {
$key = $value;
}
}
$message = "FORMULARIO DE CONTACTOn" .
"nNombre: " . $nombre .
"nMail: " . $email .
"nTelefono: " . $telefono .
"nComentarios: " . $comentarios;
$to = 'xxxxxxxxxx@gmail.com';
$subject = 'Nuevo comentario en noticia01';
$headers = "From: xxxxxxxxxx@gmail.comrn";
mail($to,$subject,$message,$headers);
header('Location: gracias.html');
} else {
echo 'No podes acceder a este archivo directamente.';
}
?>
No comments posted yet
Your Answer:
Login to answer
116
9
Other forums
File upload issues
Hi Guys,
Can anyone see any issues with this code:
Code: $setImage= 'productimages/' . dat
How to ask a regex question?
Hi, I thought I'd share some of my insight after seeing too many bad questions that either get ignor
how do i make a string??
hey guys,
can someone please tell me how to put data from the glob function into a string
How to add advertisment on top of videos
Hello,
I was told that i should find the answer for this problem in this forums.
I searched a
Oracle Connectivity
Hi Every One,
Can we access SAP from oracle database.If it possible then please spec
Php If in MySql query (hiding labels if a field is empty)
Okay, I've been trying to do this for a while, and I'm finally going to ask for help so I can get th
This must be easy , pulling the last record of the day, every day, from a txt
I have a txt file logging weather data every minutes (so 1 record per minute). I want to extract the
How do I send data using an html link
Hi
If I have
<a href="main_file.php">
How do I send data t
Multi language - seo links
Im trying to figure out the best method to have a multi language website that will function with seo
need help to creat database
Hello Team, please guys i am stuck from three days with paypal issue for IPN but no luck yet now i w