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
Parse String
I need to parse the string below into three variables. How would I do that?
john + 10/20/2008
Error in SQL Syntax HELP!!!
I have this page:
Code: <?php
session_start();
//connect to server and s
Syntax error
hi im having a little trobble with this script
-------------------------------------------------
Typedef struct vs just struct
Anyone know the rationale for using typedef for structs when a struct is itself a typedef? I have s
Help adding strtolower( to my in_array
strtolower i need to add it to this to work, iuno how.
Code: $moderators = array('Admin', 'ba
Inserting a check in checkbox from array value
Hello all,
I have a bit of code that works for a select option box, but does not work for my chec
pass form variables straight to email, no database required?
hello all,
im working on this form...
http://www.adobedayevents.com/project_request/pr
ereg_replace()
Basically what i need to do is
$title = "This Suck's"
$striped = ereg_repl
TinyMCE / Ajax Postback Problem
Hiya all,
I have a page which loads the TinyMCE editor. On the postback I obviously want to f
Get ID from Database when Posting with a HTML Form
I have a form I am submitting to a MySql database. Each product has an ID # attached to it that auto