Advertisement
TanaStorm

Untitled

Mar 21st, 2021
456
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.46 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="es">
  3. <head>
  4.   <meta charset="utf-8">
  5.   <title>RESULT</title>
  6.   <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. </head>
  8.  
  9. <body>
  10. <?php
  11.  function get($var, $m = "")
  12.  {
  13.    if (!isset($_REQUEST[$var])) {
  14.      $tmp = (is_array($m)) ? [] : "";
  15.    } elseif (!is_array($_REQUEST[$var])) {
  16.      $tmp = trim(htmlspecialchars($_REQUEST[$var], ENT_QUOTES, "UTF-8"));
  17.    } else {
  18.      $tmp = $_REQUEST[$var];
  19.        array_walk_recursive($tmp, function (&$valor) {
  20.        $valor = trim(htmlspecialchars($valor, ENT_QUOTES, "UTF-8"));
  21.      });
  22.    }
  23.    return $tmp;
  24.  }
  25.  
  26. $side  = get("side");
  27. $corner = get("corner");
  28. $sideOK   = false;
  29. $cornerOK  = false;
  30.  
  31.   if ($side == "") {
  32.     print "  <p class=\"warning\">You must add the parameter (x,y).</p>\n";
  33.     print "\n";
  34.   }  else {
  35.     $sideOK = true;
  36.   }
  37.   if ($corner == "") {
  38.     print "  <p class=\"warning\">You must add the parameter (rx, ry).</p>\n";
  39.     print "\n";
  40.   }  else {
  41.     $cornerOK = true;
  42.   }
  43.  
  44.   if ($sideOK && $cornerOK){
  45.     print " <svg version=\"1.1\" xmlns=\"http:/www.w3.org/2000/svg\"\n"
  46.     . " width=\"" .($side+10) ."px\" height=\"" . ($side + 10) . "px\">\n";
  47.     print " <rect fill=\"white\" stroke=\"black\" stroke-width=\"10\" "
  48.     . "x=\"5\" y=\"5\" width=\"$side\" height=\"$side\" rx=\"$corner\" ry=\"$corner\" />\n";
  49.     print " </svg>\n";
  50.     print "\n";
  51.   }
  52.   ?>
  53.   <p><a href="form.php">Go back.</a></p>
  54. </body>
  55. </html>
  56.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement