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.';
}
?>
116
9
Other php-forum
i need help with php header and footer
I have designed a header and footer for my site and they seem to be ok when they are running individ
Facebook status update API
Hello,
So, I'm trying to create my first Facebook application with PHP.
Basic ideas fo
PHP error. Need help urgently
Hi,
I am programming a php site and have a problem that i just cant find out how to fix. When
values in array being escaped
I would like to submit some values - back to the same form for checking before processing...
PHP and XML image gallery variable issue
I'm trying to display the large image on the same page as the thumbnails, to do that I'm passing a v
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
Multidimensional $_POST
Hello
How to get a single array from array of array (2 - dimension).
For example I have a
puting for loop in 1 value
hi ,
how do i put this code in 1 value:
Code: <?php
for ($i=1; $i<=5; $i
Port scanner problem
Hai
recently i developed one app through which u can check the opened and closed ports under an
Creating an invoice
Using fpdf I am trying to create an invoice to send to clients. The products are sold in pricing tie