-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirst.php
32 lines (29 loc) · 860 Bytes
/
first.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
<?php
$txtNombre = "";
$txtResult = "Favor ingresar su nombre y luego dar click en Procesar.";
if (isset($_POST['txtNombre'])) {
$txtNombre = $_POST['txtNombre'];
$txtResult = "Hola " . $txtNombre . "!";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Primer documento PHP</title>
</head>
<body>
<h1>Mi Primer PHP Script</h1>
<form action="first.php" method="post">
<label for="txtNombre">
Nombre: <input type="text" name="txtNombre" placeholder="Nombre Completo" id="txtNombre" />
</label>
<br>
<button id="btnProcesar" type="submit" name="btnProcesar">Procesar</button>
</form>
<section>
<?php echo $txtResult; ?>
</section>
</body>
</html>