Тег <keygen />




Этот тег создает пары ключей.



Аргумент Значение
autofocus autofocus
challenge challenge
disabled disabled
form form_id
keytype rsa
dsa
ec
name text




index.php
  • <!DOCTYPE html>
  • <html>
  • <head>
  •  <meta charset="utf-8" />
  •  <title>New Page</title>
  • </head>
  • <body>
  • <?php
  • if($_SERVER['REQUEST_METHOD'] == 'POST') {
  •  $a = (string)trim(htmlspecialchars($_POST['a'], ENT_QUOTES));
  •  if($_REQUEST['clear']) {
  •   $a = null;
  •  }
  • }
  • ?>
  • <form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
  •  <fieldset>
  •   <legend>This data will send into a server</legend>
  •   <input type="text" name="a" value="<?php echo $a; ?>" />
  •   &nbsp;&nbsp;&nbsp;
  •   <label>Enter a text</label>
  •   <br />
  •   <br />
  •   <keygen name="keygen1" />
  •   &nbsp;&nbsp;&nbsp;
  •   <label>Encryption</label>
  •   <br />
  •   <br />
  •   <input type="submit" name="perform" value="Perform" />
  •   &nbsp;&nbsp;&nbsp;
  •   <input type="submit" name="clear" value="&nbsp;&nbsp;&nbsp;Clear&nbsp;&nbsp;&nbsp;" />
  •  </fieldset>
  •  <br />
  •  <fieldset>
  •   <legend>Reading data from a server</legend>
  •   <?php
  •   if($_SERVER['REQUEST_METHOD']=='POST' && $_REQUEST['perform'] && !$_REQUEST['clear']) {
  •    echo $a;
  •   }
  •   else {
  •    echo null;
  •   }
  •   ?>
  •   <br />
  •  </fieldset>
  • </form>
  • </body>
  • </html>
  • <!DOCTYPE html>
  • <html>
  • <head>
  •  <meta charset="utf-8" />
  •  <title>New Page</title>
  • </head>
  • <body>
  • <?php
  • if($_SERVER['REQUEST_METHOD'] == 'POST') {
  •  $a = (string)trim(htmlspecialchars($_POST['a'], ENT_QUOTES));
  •  if($_REQUEST['clear']) {
  •   $a = null;
  •  }
  • }
  • ?>
  • <form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
  •  <fieldset>
  •   <legend>This data will send into a server</legend>
  •   <input type="text" name="a" value="<?php echo $a; ?>" />
  •   &nbsp;&nbsp;&nbsp;
  •   <label>Enter a text</label>
  •   <br />
  •   <br />
  •   <keygen name="keygen1" />
  •   &nbsp;&nbsp;&nbsp;
  •   <label>Encryption</label>
  •   <br />
  •   <br />
  •   <input type="submit" name="perform" value="Perform" />
  •   &nbsp;&nbsp;&nbsp;
  •   <input type="submit" name="clear" value="&nbsp;&nbsp;&nbsp;Clear&nbsp;&nbsp;&nbsp;" />
  •  </fieldset>
  •  <br />
  •  <fieldset>
  •   <legend>Reading data from a server</legend>
  •   <?php
  •   if($_SERVER['REQUEST_METHOD']=='POST' && $_REQUEST['perform'] && !$_REQUEST['clear']) {
  •    echo $a;
  •   }
  •   else {
  •    echo null;
  •   }
  •   ?>
  •   <br />
  •  </fieldset>
  • </form>
  • </body>
  • </html>