Is it possible to maintain a Div-Container without reloading in PHP without using AJAX?

To maintain a Div-Container without reloading in PHP without using AJAX, you can use PHP sessions to store the content of the Div-Container and update it dynamically. By storing the content in a session variable, you can retrieve and display it without the need for a page reload.

<?php
session_start();

// Check if the content has been submitted
if(isset($_POST['content'])){
    $_SESSION['div_content'] = $_POST['content'];
}

// Display the Div-Container content
echo '<div id="div-container">';
if(isset($_SESSION['div_content'])){
    echo $_SESSION['div_content'];
}
echo '</div>';

// Form to submit new content
echo '<form method="post">';
echo '<textarea name="content"></textarea>';
echo '<input type="submit" value="Submit">';
echo '</form>';
?>