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 Like 9 Dislike
Previous forums Next forums
Other forums

Allowing ' and "
Hello everyone,

I am creating a form where users submit information to go into a database. I

multiple recipients + dbuser mail recall
Hello,

I am building a php login script.

When the user registers the script will send

Content-Disposition: attachment; filename=... not working as i thought it should
taken the following code from the php.net site the script is not working.

what is not happeni

pagination - need help on passing of search query.
Hi, i have been trying for days but couldn't get this sorted out. Would like some professional help

2 things: enter doesn't work in IE & empty form
i have this search form that works well except for 2 things.

1) on IE when i hit enter instea

How would I convert this into code using an if statement?
ES equals exam score m equals $mean s equals $total. I already coded my mean and total so I'm not g

How can i steam a video on my PHP site? (non YouTube)
Basically I have a PHP site and don't want to give page rank to YouTube. I just want to stream a bas

Checking if multidimensional array is empty?
I have a for with multiple test input fields. Specifically the user submits multiple names and ages

EXplanation help
Hey all,

I am still fairly new to PHP programming and I am trying to put together a page wher

getting weird error..
okay, I'm getting an error on this particular function, something about the syntax in the mysql LIMI

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash