PHP - duda formulario de incidencias

 
Vista:

duda formulario de incidencias

Publicado por juan (2 intervenciones) el 19/11/2018 22:22:20
b) A partir de los datos del formulario se enviará un correo al departamento de sistemas
utilizando esta plantilla.
El usuario <usuario> reporta una indicendia en el ordenador <numero> en la sala <sala>.
La incidencia se detectó el día <fecha> a las <hora>. Se comunica el día <fecha_envio> a las
<hora_envio>.

mi plantilla hecha:
formulario.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<!DOCTYPE html>
<html lang="es-ES">
  <head>
    <meta charset="utf-8">
    <title>Formulario de incidencias informáticas</title>
    <link rel="stylesheet" type="text/css" href="style.css">
  </head>
  <body>
    <?php
		/* si va bien redirige a principal.php si va mal, mensaje de error */
		if ($_SERVER["REQUEST_METHOD"] == "POST") {
			require "enviar_correo.php";
			$mensaje
			if($resul===TRUE){
				echo "Correo enviado correctamente<hr>";
			}else{
				echo "Error al enviar el correo<hr>";
			}
		}
		?>
		<form action = "<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?> method = "POST">
      <fieldset>
      <br></br>
        <h1>Formulario de incidencias</h1>
        <label for="nombre_usuario">Usuario: </label>
        <input type="text" name="USUARIO" placeholder="nombre usuario">
        <br></br>
        <label for="SALA">SALA </label>
        <select name="sala" id="Seleccionar">
          <option value="1">1</option>
          <option value="2">2</option>
          <option value="3">3</option>
        </select>
        <br></br>
       <label for="nº equipo">Nº EQUIPO: </label>
       <input type="text" name="nº equipo" placeholder="555">
        <br></br>
        <label for="PROBLEMA">PROBLEMA </label>
        <select name="problema" id="problema">
          <option value="Monitor">Monitor</option>
          <option value="Aplicaciones">Aplicaciones</option>
          <option value="Red">Red</option>
          <option value="impresora">impresora</option>
          <option value="Hardware">Hardware</option>
          <option value="Otros">Otros</option>
        </select>
        <br><br>
        <label for="descripcion">DESCRIPCIÓN ADICIONAL: </label>
        <br>
        <textarea name="Descripción" rows="3" cols="40" id="descripcion_incidencia">Descripción</textarea>
        <br><br>
        <label for="fecha detencion" >FECHA DETENCIÓN </label>
        <input id="date" type="date">
        <br></br>
       <label for="HORA  DETENCION" >HORA DETENCION </label>
        <label for="fecha detenccion" > </label>
        <input id="time" type="time">
        <br></br>
<label for="foto o pantallazo"> foto o pantallazo</label>
         <input name="seleccionar" type="file" text="seleccionar">
 </form>
   <br></br><br></br><br></br>       
        <imput type="button" value="enviar"  style="float:left;">
        <button  type="submit">Enviar</button > &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
         <imput type="button" value="enviar"  style="float:right;">
        <button  type="reset">limpiar</button >
      </fieldset>
    </form>
  </body>
</html>


css que se llama style.css:

1
2
3
body {
  background-color:#6495ED;
}


ejemplo enviar correo formulario: aqui esta la duda,cuando doy enviar se tiene que mandar correo electrónico

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<html>
	<head>
		<title>Formulario de envío de correo</title>
		<meta charset = "UTF-8">
	</head>
	<body>
		<?php
		/* si va bien redirige a principal.php si va mal, mensaje de error */
		if ($_SERVER["REQUEST_METHOD"] == "POST") {
			require "enviar_correo.php";
			$resul = enviar_correo($_POST['direccion'], $_POST['texto'],$_POST['asunto']);
			if($resul===TRUE){
				echo "Correo enviado correctamente<hr>";
			}else{
				echo "Error al enviar el correo<hr>";
			}
		}
		?>
		<form action = "<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" method = "POST">
			Dirección: <input name="direccion"><br>
			Asunto: <input name="asunto"><br>
			Texto: <input name="texto"><br>
			<input type = "submit">
 
		</form>
	</body>
</html>


correo composer y demas esta todo configurado, Puedo recibir correos
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder