10c03-1.php

来自「介绍PHP5的给类型函数应用」· PHP 代码 · 共 19 行

PHP
19
字号
<?php// If we have a 'GET' parameter called state and it is set to 'save'if (isset($_GET['state']) && ($_GET['state'] == 'save')) {    // Check if the POST data is blank:    if (count($_POST) == 0) {        // Looks like a bookmark, the GET existed but no post:        die("ERROR:  This page has been improperly accessed.");    }        // Otherwise, output some data:    echo "<p>You claim to live in state: {$_POST['state']}</p>\n";    echo "<p>The script in is the '{$_GET['state']}' state.</p>\n";}?><form action="<?= $_SERVER['PHP_SELF'] ?>?state=save"  method="post" name="f1"><p>In what state do you live? <input name="state" type="text" /></p><p><input type="submit" /></p></form>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?