* @copyright 2025 Bartolomé Sintes Marco * @license http://www.gnu.org/licenses/agpl.txt AGPL 3 or later * @version 2025-01-31 * @link http://www.mclibre.org * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ // Accedemos a la sesión session_name("sesiones-2-13"); session_start(); // Si falta una de los dos variables de sesión, reiniciamos los valores if (!isset($_SESSION["puntosG"], $_SESSION["puntosM"], $_SESSION["moneda"])) { $_SESSION["puntosG"] = 0; $_SESSION["puntosM"] = 0; $_SESSION["moneda"] = ""; $_SESSION["caraG"] = "😼"; $_SESSION["caraM"] = "🙊"; } ?> Cara o cruz. Sesiones (2). Sesiones. Ejercicios. PHP. Bartolomé Sintes Marco. www.mclibre.org

Cara o cruz

Haga clic en uno de los botones:

\n"; // Mostramos la puntuación del gato print " \n"; print " \n"; // Mostramos la puntuación del mono print " \n"; print " \n"; print " \n"; // Mostramos la cara del gato print " \n"; // Mostramos la moneda print " \n"; // Mostramos la cara del mono print " \n"; print " \n"; ?>
Jugador A Resultado Jugador B
$_SESSION[puntosG]$_SESSION[puntosM]
$_SESSION[caraG]$_SESSION[moneda]$_SESSION[caraM]