<title>QR</title>
                  
                  
                      </head>
                  
                  
                      <body>
                  
                  
                  
                  
                  
                      <?php
                  
                  
                      static $result;
                  
                  
                      if(isset($_POST['bookname'])){
                  
                  
                          $bookname = $_POST["bookname"];
                  
                  
                          $author = $_POST["author"]; 
                  
                  
                          $result .= " $bookname  "."$author"; 
                  
                  
                          setcookie("Result", $result, time()+3600);
                  
                  
                      }
                  
                  
                      ?>
                  
                  
                           <form method="POST" action="codewars.php">
                  
                  
                               <input type="text" name="bookname">
                  
                  
                               <input type="text" name="author">
                  
                  
                               <input type="submit" value="Add" >
                  
                  
                           </form>
                  
                  
                         <?php  
                  
                  
                         if(isset($_COOKIE['Result']))
                  
                  
                         echo $_COOKIE["Result"] . '</br>'; 
                  
                  
                         ?>
                  
                  
                      </body>
                  
                  
                  </html>
                  
                  
                
Как минимум $result надо не static, а считывать из $_COOKIE
Обсуждают сегодня