Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="es">
- <head>
- <meta charset="utf-8">
- <title>RESULT</title>
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- </head>
- <body>
- <?php
- function get($var, $m = "")
- {
- if (!isset($_REQUEST[$var])) {
- $tmp = (is_array($m)) ? [] : "";
- } elseif (!is_array($_REQUEST[$var])) {
- $tmp = trim(htmlspecialchars($_REQUEST[$var], ENT_QUOTES, "UTF-8"));
- } else {
- $tmp = $_REQUEST[$var];
- array_walk_recursive($tmp, function (&$valor) {
- $valor = trim(htmlspecialchars($valor, ENT_QUOTES, "UTF-8"));
- });
- }
- return $tmp;
- }
- $side = get("side");
- $corner = get("corner");
- $sideOK = false;
- $cornerOK = false;
- if ($side == "") {
- print " <p class=\"warning\">You must add the parameter (x,y).</p>\n";
- print "\n";
- } else {
- $sideOK = true;
- }
- if ($corner == "") {
- print " <p class=\"warning\">You must add the parameter (rx, ry).</p>\n";
- print "\n";
- } else {
- $cornerOK = true;
- }
- if ($sideOK && $cornerOK){
- print " <svg version=\"1.1\" xmlns=\"http:/www.w3.org/2000/svg\"\n"
- . " width=\"" .($side+10) ."px\" height=\"" . ($side + 10) . "px\">\n";
- print " <rect fill=\"white\" stroke=\"black\" stroke-width=\"10\" "
- . "x=\"5\" y=\"5\" width=\"$side\" height=\"$side\" rx=\"$corner\" ry=\"$corner\" />\n";
- print " </svg>\n";
- print "\n";
- }
- ?>
- <p><a href="form.php">Go back.</a></p>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement