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
Creating XML with php
I need to creat an XML with php and have successfully produced a valid output.
The problem I hav
Match stored value with the current value in a loop
Hello,
I have a MySQL db were I store articles in.
I have a form to fill these article
Warning: session_start() headers already sent error - Driving me Nuts!
I am trying my sister in laws site and I keep getting an error with my coding. I am more of a design
Best way to cross matching large datasets
Hi,
Im running a script where am I cross matching about 200 000 data sets with each other. Ea
Merger of 6 sister companies under one flagship company after go live
Dear Experts,
I need one help regarding Merger of sister companies of same group. currently we
how to use two buttons with php
hi i have one form. there are three fields which are to be filled by the user. and then there are tw
FPDF Help
I've been playing with the FPDF module. I was building a form and rolling right along and then sudde
Simpler method of getting variables from mysql
Hi Guys,
I'm trying to streamline my CMS's code and as I was writing a new page it occured to
Table trouble
i have been reading the forum for a few weeks and decided to join. i like the format and the advice
Set Categories
I am creating a submission form for somebody to come in and submit products. These products are sep