mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Simplify and secure the example (bug #42176)
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@241299 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
02149ae11d
commit
6c7e4a871e
1 changed files with 6 additions and 12 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.95 $ -->
|
||||
<!-- $Revision: 1.96 $ -->
|
||||
<chapter xml:id="language.variables" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Variables</title>
|
||||
|
||||
|
@ -944,15 +944,13 @@ echo "$a $hello";
|
|||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
if (isset($_POST['action']) && $_POST['action'] == 'submitted') {
|
||||
if ($_POST) {
|
||||
echo '<pre>';
|
||||
print_r($_POST);
|
||||
echo '<a href="'. $_SERVER['PHP_SELF'] .'">Please try again</a>';
|
||||
|
||||
echo htmlspecialchars(print_r($_POST, true));
|
||||
echo '</pre>';
|
||||
} else {
|
||||
}
|
||||
?>
|
||||
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
|
||||
<form action="" method="post">
|
||||
Name: <input type="text" name="personal[name]" /><br />
|
||||
Email: <input type="text" name="personal[email]" /><br />
|
||||
Beer: <br />
|
||||
|
@ -961,12 +959,8 @@ if (isset($_POST['action']) && $_POST['action'] == 'submitted') {
|
|||
<option value="guinness">Guinness</option>
|
||||
<option value="stuttgarter">Stuttgarter Schwabenbräu</option>
|
||||
</select><br />
|
||||
<input type="hidden" name="action" value="submitted" />
|
||||
<input type="submit" name="submit" value="submit me!" />
|
||||
<input type="submit" value="submit me!" />
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
|
Loading…
Reference in a new issue