P.D: adjunto el codigo...
Código HTML:
<body>
Código PHP:
<?php
if (!$HTTP_POST_VARS){
$band = false;
?>
Código HTML:
<table align="center" width="475"> <tr> <td> <fieldset style="border:double #999999"> <legend><strong>Enviar clave</strong></legend> <form id="form" name="form" method="post" action="enviar_clave_delegado.php"> <table width="270" border="0" align="center" cellpadding="1" cellspacing="0"> <tr> <td><strong>Nombre</strong></td> <td><label> <input name="nombre" type="text" id="nombre" size="30" style="border-color: #2124FF" /> </label></td> </tr> <tr> <td><strong>Email</strong></td> <td><label> <input name="email" type="text" id="email" size="30" style="border-color: #2124FF" /> </label></td> </tr> <tr> <td><strong>Codigo</strong></td> <td><label> <input name="codigo" type="text" id="codigo" size="30" style="border-color: #2124FF" /> </label></td> </tr> <tr> <td colspan="2" height="50"><div align="center"> <label> <input type="submit" name="button" id="button" value="Enviar" /> </label> </div></td> </tr> </table> </form> </fieldset> </td> </tr> </table>
Código PHP:
<?php
}
else
{
$band = true;
//Estoy recibiendo el formulario, compongo el cuerpo
$cuerpo = "Formulario enviado\n";
$cuerpo .= "Nombre: " . $HTTP_POST_VARS["nombre"] . "\n";
$cuerpo .= "Email: " . $HTTP_POST_VARS["email"] . "\n";
$cuerpo .= "Comentarios: " . $HTTP_POST_VARS["codigo"] . "\n";
//mando el correo...
mail($email,"Clave recibida",$cuerpo);
}
if($band == true)
{
?>
Código HTML:
<script language="javascript"> //doy las gracias por el envío alert("Gracias por rellenar el formulario. Se ha enviado correctamente."); </script> <script language="javascript"> window.location="menu_administrador.php" </script>
Código PHP:
<?php
}
?>
Código HTML:
</body> </html>