Re: mail

From: Date: Wed, 06 May 2009 04:08:06 +0000
Subject: Re: mail
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-46173@lists.php.net to get a copy of this message
Emiliano Boragina wrote:
<?php if(isset($_POST["empresa"]) && isset($_POST["nombre"]) && isset($_POST["telefono"]) && isset($_POST["mail"]) && isset($_POST["asunto"]) && isset($_POST["mensaje"]) ) {
<snip>
I test this code to send mail, but I am testing this printing $contenido. If nothing is ISSET must be print "ERROR", but not, if I send de form empty this code print $contenido. It is not working, why?
Maybe the post variables are there but they are empty. $form_vars = array('empresa', 'nombre', 'telefono'); $error = false; foreach ($form_vars as $var) { if (!isset($_POST[$var])) {
     echo "Error - $var is missing\n";
     $error =  true;
     break;
} if (empty($_POST[$var])) {
    echo "Error: $var is empty (no value supplied)\n";
     $error =  true;
    break;
} } if ($error) { die(); } send_email_here(); -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.db (#46173) next »