lustra łazienkowe ledowe, lustra w ramach, okrągłe lustra, lustra do salonu

lustra.pl -- sklep z lustrami

Lustra łazienkowe z oświetleniem LED, lustra z półką i oświetleniem, lustra w ramach metalowych, drewnianych. Producent od 1982 roku.

{
   "environ" : {
      "CONTEXT_DOCUMENT_ROOT" : "/root/Omega/Domains/Produkty_Typowe/Lustra/Portal",
      "CONTEXT_PREFIX" : "",
      "DOCUMENT_ROOT" : "/root/Omega/Domains/Produkty_Typowe/Lustra/Portal",
      "GATEWAY_INTERFACE" : "CGI/1.1",
      "HTTPS" : "on",
      "HTTP_ACCEPT" : "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
      "HTTP_ACCEPT_ENCODING" : "br,gzip",
      "HTTP_ACCEPT_LANGUAGE" : "en-US,en;q=0.5",
      "HTTP_CONNECTION" : "close",
      "HTTP_HOST" : "www.lustra.pl",
      "HTTP_USER_AGENT" : "CCBot/2.0 (https://commoncrawl.org/faq/)",
      "HTTP_X_FORWARDED_PROTO" : "https",
      "HTTP_X_REAL_IP" : "54.144.55.253",
      "LANG" : "pl_PL.UTF-8",
      "PATH" : "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
      "QUERY_STRING" : "",
      "REMOTE_ADDR" : "54.144.55.253",
      "REMOTE_PORT" : "53296",
      "REQUEST_METHOD" : "GET",
      "REQUEST_SCHEME" : "https",
      "REQUEST_URI" : "/cgitest.pl",
      "SCRIPT_FILENAME" : "/root/Omega/Domains/Produkty_Typowe/Lustra/Portal/cgitest.pl",
      "SCRIPT_NAME" : "/cgitest.pl",
      "SCRIPT_URI" : "https://www.lustra.pl/cgitest.pl",
      "SCRIPT_URL" : "/cgitest.pl",
      "SERVER_ADDR" : "192.168.8.1",
      "SERVER_ADMIN" : "[no address given]",
      "SERVER_NAME" : "www.lustra.pl",
      "SERVER_PORT" : "443",
      "SERVER_PROTOCOL" : "HTTP/1.0",
      "SERVER_SIGNATURE" : "",
      "SERVER_SOFTWARE" : "Apache/2.4.38 (Debian) OpenSSL/1.1.1d"
   },
   "headers" : {
      "HTTP_ACCEPT" : "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
      "HTTP_ACCEPT_ENCODING" : "br,gzip",
      "HTTP_ACCEPT_LANGUAGE" : "en-US,en;q=0.5",
      "HTTP_CONNECTION" : "close",
      "HTTP_HOST" : "www.lustra.pl",
      "HTTP_USER_AGENT" : "CCBot/2.0 (https://commoncrawl.org/faq/)",
      "HTTP_X_FORWARDED_PROTO" : "https",
      "HTTP_X_REAL_IP" : "54.144.55.253"
   },
   "input" : "",
   "params" : {}
}


standard input: 

Source code: 

#!/usr/bin/perl -CSDA 

# read STDIN, and put STDIN back on input; trick from 
# https://stackoverflow.com/questions/908113/how-can-i-get-the-entire-request-body-with-cgi-pm
	use IO::Handle;
	use IO::Scalar;
	STDIN->blocking(1); # ensure to read everything
	my $inp = '';
	{ 
	  local $/; 
	  $inp = <STDIN>;
	  my $s;
	  tie  *STDIN, 'IO::Scalar', \$s;
	  print STDIN $inp;
	  tied(*STDIN)->setpos(0);
	}
# end of trick 

use utf8; 
use CGI; 
use JSON; 
use Path::Tiny; 
use Time::Piece; 
use Encode; 

my $cgi = CGI->new;

# dane z formularza CGI w trybie "multipart/form-data; boundary=..." są przekazywane wprost na standardowym wejściu,
# czyli przez opcję "-CSDA" są już zdekodowane; wszystkie pozostałe przypadki kodują dane w postaci "url encoded", czyli
# tam gdzie są procenty, czyli po dekodowaniu otrzymuję surowe dane, które muszę ręcznie odkodować
sub decodedForSomeTypes { 
	$ENV{CONTENT_TYPE} =~ /boundary/ ? $_[0] : decode_utf8($_[0]); 
}

my $params = +{
    map { $_ => decodedForSomeTypes(scalar $cgi->param($_)) } $cgi->param()
};

my $out = JSON->new->pretty->canonical->encode({ 
	headers => { map { $_ => $cgi->http($_) } $cgi->http() },
	params => $params,
	environ => { 
		map { ($_, $ENV{$_}) } 
		# grep { ! /ROOT|PATH|REMOTE|FILENAME|SERVER|SSL/ } 
		keys %ENV
	}, 
	input => $inp, 
}); 

path(localtime->strftime("/tmp/cgitest %Y-%m-%d %H:%M:%S $$"))->spew_utf8($out); 

print <<HTML;
Content-Type: text/html; charset=utf-8

<!DOCTYPE HTML>
<html lang="pl-PL">   <!-- W3 validator kazał dopisać język -->
	<head>
		<meta charset="utf-8">

		<!-- trzeba dodać aby było responsive, zresztą i tak używam dużo flex -->
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"/>
		<style>
			pre { 
				white-space: pre-wrap; 
				color: darkblue; 
			}
			form { 
				margin: 2rem 0; 
				padding: 0.3rem; 
				border: 1px dashed grey; 
			}
			img { 
				max-width: 10rem; 
			}
		</style>
	</head>
</body>

<body> 
<a href="https://www.lustra.pl" alt="lustra ledowe z oświetleniem, bezpieczne lustra łazienkowe z oświetleniem LED, sklep z lustrami, lustra w ramach do przedpokoju">
<img src="https://www.lustra.pl/lustra_pl_logo.png" alt="lustra łazienkowe ledowe, lustra w ramach, okrągłe lustra, lustra do salonu">
<h1>lustra.pl -- sklep z lustrami</h1>
<p>Lustra łazienkowe z oświetleniem LED, lustra z półką i oświetleniem, lustra w ramach metalowych, drewnianych. Producent od 1982 roku.</p>
</a>

<pre>
$out

standard input: 
$inp
</pre>

<form method="get"> 
	<input type="submit">
	<input name="about" value="method get">
	<input name="myname" value="Alfa">
	<input name="myage" value="32">
	<input name="unicode-test" value="ĄĆĘŁŃÓŚŹŹŻ-ąćęłńóśźż-πœ©ß←↓→əŋæð„”µ≤≥»«§½€¢³²≠">
</form>

<form method="post"> 
	<input type="submit">
	<input name="about" value="method post">
	<input name="myname" value="Beta">
	<input name="myage" value="44">
	<input name="unicode-test" value="ĄĆĘŁŃÓŚŹŹŻ-ąćęłńóśźż-πœ©ß←↓→əŋæð„”µ≤≥»«§½€¢³²≠">
</form>

<form method="post" enctype="application/x-www-form-urlencoded"> 
	<input type="submit">
	<input name="about" value="method post, x-www-form-urlencoded">
	<input name="myname" value="Gamma">
	<input name="myage" value="12">
	<input name="unicode-test" value="ĄĆĘŁŃÓŚŹŹŻ-ąćęłńóśźż-πœ©ß←↓→əŋæð„”µ≤≥»«§½€¢³²≠">
</form>

<form method="post" enctype="multipart/form-data"> 
	<input type="submit">
	<input name="about" value="method post, multipart/form-data">
	<input name="myname" value="Teta">
	<input name="myage" value="66">
	<input name="unicode-test" value="ĄĆĘŁŃÓŚŹŹŻ-ąćęłńóśźż-πœ©ß←↓→əŋæð„”µ≤≥»«§½€¢³²≠">
</form>

<form method="post" enctype="text-plain"> 
	<input type="submit">
	<input name="about" value="method post, text-plain">
	<input name="myname" value="Omega">
	<input name="myage" value="45">
	<input name="unicode-test" value="ĄĆĘŁŃÓŚŹŹŻ-ąćęłńóśźż-πœ©ß←↓→əŋæð„”µ≤≥»«§½€¢³²≠">
</form>


<pre>
Source code: 

@{[ 
	($0 =~ /cgitest[0-9]?.pl/ ? (scalar `cat $0`) : "") 
	=~ s/&/&amp;/gr =~ s/"/&quot;/gr =~ s/</&lt;/gr =~ s/>/&gt;/gr 
]}
</pre> 

</body>
</html>

HTML