Você está na página 1de 6

INSTRUMENTO DE EVALUACIÓN

Código: AP5-AA1-IE1.

Programa de formación: Producción de Multimedia.

Nombre del Proyecto: Producción de Aplicativos Multimedia para el Sector


Productivo.

Actividad de Proyecto: Integración de los objetos de la multimedia

Código de la Guía: TPM-AP5-GD5


Fase del Proyecto: Ejecución

Actividad de aprendizaje 1: Identificar las herramientas integradoras de los


elementos multimediales (Action Script, Java
Script, PHP- HTML5 - CSS3)
Evidencia 3: Ejercicio propuesto en PHP (Creación de formulario HTML)

Por medio del siguiente ejercicio se creará un formulario HTML, teniendo como
base la Introducción a las herramientas integradoras (PHP).

Procedimiento a seguir:

1. Crear un archivo PHP dentro de la carpeta htdocs llamado mail.php

2. Crear un archivo HTML mail.php

3. Abrir cada uno de estos archivos en Notepad++

4. En el archivo PHP llamado mail.php se debe escribir el siguiente script.

<?php

$nombre = $_REQUEST['realname'];

1
INSTRUMENTO DE EVALUACIÓN
Código: AP5-AA1-IE1.

$email = $_REQUEST['email'];

$telefono = $_REQUEST['phone'];

$texto = (!$_REQUEST['Mensaje']) ? $_REQUEST['mensaje'] : $_REQUEST['Mensaje'];

$texto = (!$texto) ? $_REQUEST['message'] : $texto;

$destino = $_REQUEST['recipient'];

$subject = $_REQUEST['subject'];

$redirect = $_REQUEST['redirect'];

if ($nombre != '') {

$header = "From: $nombre <$email>\r\n";

else {

$header = "From: $email\r\n";

$header .= "Return-Path: $email\r\n";

$mensaje = "Nombre: $nombre\r\n";

$mensaje .="Teléfono: $telefono\r\n";

$mensaje .= "Mensaje: $texto";

mail($destino, $subject, $mensaje, $header);

header('Location: ' . $redirect);

?>

Visualización en el Notepad++

2
INSTRUMENTO DE EVALUACIÓN
Código: AP5-AA1-IE1.

5. Seguido a esto se debe crear un archivo HTML el cual llame al archivo


mail.php.

<HTM>

<HEAD>

<TITLE> Mi primer formulario en PHP</TITLE>

</HEAD>

<BODY>

<form method="POST" action="mail.php">

3
INSTRUMENTO DE EVALUACIÓN
Código: AP5-AA1-IE1.

<input type="hidden" name="recipient" value="info@susitio.com.ar">

<input type="hidden" name="subject" value="Datos del Formulario">

<input type="hidden" name="redirect" value="../gracias.html">

Nombre: <input type="text" name="realname">

<br><br>

e-m@il: <input type="text" name="email">

<br><br>

Telefono: <input type="text" name="phone">

<br><br>

Mensaje: <textarea name="Mensaje"></textarea>

<br><br>

<input type="Submit" value="Enviar mail">

</form>

</BODY>

</HTM>

4
INSTRUMENTO DE EVALUACIÓN
Código: AP5-AA1-IE1.

Visualización en el Notepad++

5
INSTRUMENTO DE EVALUACIÓN
Código: AP5-AA1-IE1.

Visualización en el servidor

Você também pode gostar