I'm trying to $_POST a variable or two back to the same page,
so that I can scroll through different years of entries in my database...
I'm not having any luck with it so far, is anyone able to tell me where I've gone wrong?
I've tried a few different techniques, but my trouble boils down to being unable to post to the same page, initially I tried <a href="">'s with the variables on the end,
but following documentation online its become a more complicated mess with the same effect...
adding in $_SERVER['PHP_SELF'], a <form> and such...
<?php
$up=$_POST['up'];
$dn=$_POST['down'];
$year = date("Y");
if(up){$year++;}
if(dn){$year--;}
?>
<h2 style="font-family: ErasDemi;">Log for <?php echo $year; ?></h2>
<form action=<?php echo $_SERVER['PHP_SELF'] ?> method='post'>
<input type='submit' name='dn' value='Last Year'/>
<input type='submit' name='up' value='Next Year'/>
</form>
Any help would be much appreciated.