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)
Did you know?Explore Trending and Topic pages for more stories like this.
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

Add User script "Could not execute query"
This should be an easy script but I can't get it to run. Can someone please help me?

<

SAP Business Suite
Hi all:

Within the SAP Business Suite solution I would like to ask you the main differenc

Multiple WHILE loops help
Hi there. I'm writing an application that is pulling and displaying results for real estate listing

do while...woes
I'm sure this is childsplay but it is stumping me, everytime i try what I think would make this work

upload photo limits
ive got a upload photo script and im just trying to make more secure currently it limits size and as

xApp Analytics in BI 7.0
Dear all,

I am trying to implement xApp Analytics in BI 7.0. After I installed the analyt

Navigation include for all site directories
Hi,

I need a navigation include that can deal with directories at different levels on a site.

Include a php
Hello,

I'm trying to include a function that shows the recent searches.
Example I have <

file_put_contents and createimagefromjpeg
All,
I do somethings and then I have the following code:
file_put_contents('./test/'.$filename

Any Good MMORPGs you've played?
I'm about to have ALOT of free time on my hands (finished highschool) and I need something to fill t

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