Hello, my friend🙂 I found the solution in another way: Javascript.
<head>:
<script language="javascript">
// function saves scroll position
function fScroll(val)
{
var hidScroll = document.getElementById('hidScroll');
hidScroll.value = val.scrollTop;
}
var seconds = 5;
window.setTimeout( 'autoRefresh();', 1000 * seconds );
function autoRefresh() {
document.forms['myforms'].submit();
}
<?php if($_POST['a']) {
?>
// function moves scroll position to saved value
function fScrollMove(what)
{
document.getElementById('scrollDiv').scrollTop = <?php echo $_POST['a']; ?>;
}
<?php
}?>
</script>
inside <body>:
<?php if($_POST['a']) { echo "onload=" fScrollMove('scrollDiv');\""; } ?>"
<body>:
<form method="POST" action="index.php<?php if($_GET['page']) { echo "?page=" . $_GET['page']; } ?>" name="myforms">
<input type="hidden" id="hidScroll" name="a">
<div id="scrollDiv" onscroll="fScroll(this);">
//here go a lot of results
</div>
</form>
I am now trying just to get the form submited not on timeout, but on every refresh of the page! I tried with onunload="document.forms['myforms'].submit();"
but it is not working!
Ideas?