Is it possible to create a toggle session() using tag or button

I have an intention to create a toggle button in my web page.Usually, I am using GET_ method. But, just for an excitement, Is it possible to create a toggle session() using a single tag or by using button> tag?

I did in this way but its not working.Have any idea?Please share.

main page.php

<div id=”dv_filter”>
<a href=”router.php” id=”filter_link”> >>Filters</a>
</div>

router.php

<?php
function start(){
session_start();
if(isset($_SESSION[‘current’])){
$_SESSION[‘oldlink’]=$_SESSION[‘current’];
}else{
$_SESSION[‘oldlink’]=’no previous page’;
}
$_SESSION[‘current’]=$_SERVER[‘PHP_SELF’];
}
?>

Any valuable suggestions or any critical editions are heartily welcomed.

Read more here:: <a href=https://wordpress.stackexchange.com/questions/334380/is-it-possible-to-create-a-toggle-session-using-a-tag-or-button target="_blank" title="Is it possible to create a toggle session() using tag or button” rel=nofollow>Is it possible to create a toggle session() using tag or button

Leave a Reply

Your email address will not be published. Required fields are marked *