PHP practical exam.

This commit is contained in:
Nicolás A. Ortega Froysa 2022-11-17 20:14:01 +01:00
parent 84cadf3fb4
commit 1693580525
15 changed files with 177 additions and 0 deletions

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg"
width="140" height="140" viewBox="-10 -10 140 140">
<rect x="0" y="0" width="120" height="120" rx="10" ry="10"
fill="#E0E0E0" stroke="black" stroke-width="5" />
<circle cx="60" cy="62" r="9" fill="white" />
<circle cx="60" cy="60" r="9" fill="black" />
</svg>

After

Width:  |  Height:  |  Size: 382 B

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg"
width="140" height="140" viewBox="-10 -10 140 140">
<rect x="0" y="0" width="120" height="120" rx="10" ry="10"
fill="#E0E0E0" stroke="black" stroke-width="5" />
<circle cx="30" cy="32" r="9" fill="white" />
<circle cx="30" cy="30" r="9" fill="black" />
<circle cx="90" cy="92" r="9" fill="white" />
<circle cx="90" cy="90" r="9" fill="black" />
</svg>

After

Width:  |  Height:  |  Size: 479 B

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg"
width="140" height="140" viewBox="-10 -10 140 140">
<rect x="0" y="0" width="120" height="120" rx="10" ry="10"
fill="#E0E0E0" stroke="black" stroke-width="5" />
<circle cx="30" cy="32" r="9" fill="white" />
<circle cx="30" cy="30" r="9" fill="black" />
<circle cx="60" cy="62" r="9" fill="white" />
<circle cx="60" cy="60" r="9" fill="black" />
<circle cx="90" cy="92" r="9" fill="white" />
<circle cx="90" cy="90" r="9" fill="black" />
</svg>

After

Width:  |  Height:  |  Size: 576 B

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg"
width="140" height="140" viewBox="-10 -10 140 140">
<rect x="0" y="0" width="120" height="120" rx="10" ry="10"
fill="#E0E0E0" stroke="black" stroke-width="5" />
<circle cx="30" cy="32" r="9" fill="white" />
<circle cx="30" cy="30" r="9" fill="black" />
<circle cx="30" cy="92" r="9" fill="white" />
<circle cx="30" cy="90" r="9" fill="black" />
<circle cx="90" cy="32" r="9" fill="white" />
<circle cx="90" cy="30" r="9" fill="black" />
<circle cx="90" cy="92" r="9" fill="white" />
<circle cx="90" cy="90" r="9" fill="black" />
</svg>

After

Width:  |  Height:  |  Size: 673 B

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg"
width="140" height="140" viewBox="-10 -10 140 140">
<rect x="0" y="0" width="120" height="120" rx="10" ry="10"
fill="#E0E0E0" stroke="black" stroke-width="5" />
<circle cx="30" cy="32" r="9" fill="white" />
<circle cx="30" cy="30" r="9" fill="black" />
<circle cx="30" cy="92" r="9" fill="white" />
<circle cx="30" cy="90" r="9" fill="black" />
<circle cx="60" cy="62" r="9" fill="white" />
<circle cx="60" cy="60" r="9" fill="black" />
<circle cx="90" cy="32" r="9" fill="white" />
<circle cx="90" cy="30" r="9" fill="black" />
<circle cx="90" cy="92" r="9" fill="white" />
<circle cx="90" cy="90" r="9" fill="black" />
</svg>

After

Width:  |  Height:  |  Size: 770 B

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg"
width="140" height="140" viewBox="-10 -10 140 140">
<rect x="0" y="0" width="120" height="120" rx="10" ry="10"
fill="#E0E0E0" stroke="black" stroke-width="5" />
<circle cx="30" cy="32" r="9" fill="white" />
<circle cx="30" cy="30" r="9" fill="black" />
<circle cx="30" cy="62" r="9" fill="white" />
<circle cx="30" cy="60" r="9" fill="black" />
<circle cx="30" cy="92" r="9" fill="white" />
<circle cx="30" cy="90" r="9" fill="black" />
<circle cx="90" cy="32" r="9" fill="white" />
<circle cx="90" cy="30" r="9" fill="black" />
<circle cx="90" cy="62" r="9" fill="white" />
<circle cx="90" cy="60" r="9" fill="black" />
<circle cx="90" cy="92" r="9" fill="white" />
<circle cx="90" cy="90" r="9" fill="black" />
</svg>

After

Width:  |  Height:  |  Size: 867 B

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.2 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 9.3 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 4.9 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 324 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 124 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<title>Dice Game</title>
</head>
<body>
<h1>Ejercicio 1: El Juego del Dado Más Alto</h1>
<p>Actualice la página para una nueva tirada.</p>
<?php
$player1 = rand(1,6);
$player2 = rand(1,6);
?>
<table>
<tr>
<th>Jugador 1</th>
<th>Jugador 2</th>
<th>Resultado</th>
</tr>
<tr>
<td><img src="imgs/<?= $player1 ?>.svg" /></td>
<td><img src="imgs/<?= $player2 ?>.svg" /></td>
<td>
<?php
if($player1 > $player2)
echo "Ha ganado el jugador 1";
else if($player2 > $player1)
echo "Ha ganado el jugador 2";
else
echo "Han empatado";
?>
</td>
</tr>
</table>
<p>Última modificación de esta página: <?= date('Y-m-d', filemtime(__FILE__)) ?>
</body>
</html>

View File

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<title>Encuesta</title>
</head>
<body>
<h1>Encuesta (Formulario)</h1>
<form action="resultado.php" method="post" >
Indique cuál es su opción preferida:<br />
<input type="radio" name="favorite" value="docker" >Docker</input><br />
<input type="radio" name="favorite" value="dns" >DNS</input><br />
<input type="radio" name="favorite" value="php" >PHP</input><br />
<input type="radio" name="favorite" value="mysql" >MySQL</input><br />
<input type="radio" name="favorite" value="simfony" >Simfony</input><br />
<input type="radio" name="favorite" value="wordpress" >WordPress</input><br />
<input type="submit" /><input type="reset" />
</form>
</body>
</html>

View File

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<title>Resultado</title>
</head>
<body>
<h1>Encuesta (Resultado)</h1>
<?php
if(isset($_POST["favorite"])) {
?>
<p>Su opción es:</p>
<img src="imgs/<?= $_POST["favorite"] ?>.svg" width="100px" />
<?php
} else {
?>
<p><b>ERROR:</b> No ha seleccionado ninguno.</p>
<?php
}
?>
<p><a href="nicolas-ej2.php" >Volver al formulario</a></p>
<p>Última modificación de esta página: <?= date('Y-m-d', filemtime(__FILE__)) ?>
</body>
</html>