Re: mail

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux