PIXELE
Program udało mi się napisać dzięki pomocy Kolegom z tego forum, którzy odpowiadali na moje posty w dziale Przedszkole.
Poniżej kod. Będę wdzięczny za ewentualne uwagi.
<html> <head> <meta http-equiv="Content-Language" content="pl"> <title>Szerokość okna</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <style type="text/css"> .one { width: height: 20px; background: red; margin:0; padding:0; } </style> <body> <form name="adam" action="a4.php" method="post" onSubmit="hres0()"> Podaj długość paska w pixelach: <input type="text" name="width" /> <input type="hidden" name="hres" value=""> <input type="submit" value="Zatwierdź"/> </form> <?php if($_POST["width"]){ if (!filter_input(INPUT_POST, 'width', FILTER_VALIDATE_INT, $int_options)){?><br /><?php }else{ ?> px!<br /><br /><div class="one"></div> <?php }}?> <script type="text/javascript"> function hres0() { jsvar=(window.innerWidth - 8); document.adam.hres.value = jsvar; } </script> </body> </html>