I'm calling viewlog.php which display the xx rows of log table in a frame
The viewlog.php SQl call work.
no issue initializing the $_SESSION
I'm trying to add a next and prev button using a function that increase or decreased $_SESSION['offset']
<input type="button" value=" < PREV " onclick="PIframe();">
<input type="button" value = " NEXT >" onclick="NIframe();">
<iframe src="viewlog.php?os=<?php echo $_SESSION['offset']."&osl=" . $_SESSION['limit'];?>" name="LogIframe" id="LogIframe" />
</iframe
I'm 100% sure the Viewlog.php is getting the value of &_SESSION['offset']
My problem is
- I'm not sure if the function are being executed
- I'm not sure if the $_SESSION['offset'] is being updated
I don't think document.getElementById is being run
<?php function NIframe() { $_SESSION['offset'] = $_SESSION['offset'] + $_SESSION['limit']; document.getElementById('LogIframe').contentWindow.location.reload(); } function PIframe() { $_SESSION['offset'] = $_SESSION['offset'] - $_SESSION['limit']; document.getElementById('LogIframe').contentWindow.location.reload(); } ?>
I tried converting the Function to Javascript. The reload works but the $_SESSION is not being updated
<script type="text/javascript">
function NIframe() {
<?php
$_SESSION['offset'] = $_SESSION['offset'] + $_SESSION['setofLimit'];
?>
document.getElementById('LogIframe').contentWindow.location.reload();
}
</script>
Help