12c02-2.php
来自「介绍PHP5的给类型函数应用」· PHP 代码 · 共 31 行
PHP
31 行
<?php// The View page// First we need to check if they are logged in, and if not, make them:session_start();if (!(isset($_SESSION['valid']) && $_SESSION['valid'])) { // Back to login for you// header('Location: login.php'); header('Location: 12c02-1.php'); exit();}// Now, set some default values in case they haven't told us anything yet:$fname = isset($_SESSION['name']) ? $_SESSION['name'] : '[Unknown]';$fcolor = isset($_SESSION['color']) ? $_SESSION['color'] : '[Unknown]';?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>View</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /></head><body><p>This is our website, thanks for logging in!</p><p>You've told us that your Full Name is <?= $fname ?></p><p>We somehow also know that your favorite color is <?= $fcolor ?></p><!--<p>Options: | <a href="edit.php">Edit Data</a> |<a href="login.php?logoff=true">Log Off</a> |</p>--><p>Options: | <a href="12c02-3.php">Edit Data</a> |<a href="12c02-1.php?logoff=true">Log Off</a> |</p></body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?