php session

<?php
    session_start();
    
    if(isset($_SESSION['view'])){
        $_SESSION['view'] = $_SESSION['view'] + 1;
    }else{
        $_SESSION['view'] = 0;
    
    }
?>
<!DOCTYPE HTML>
<html>
    <head>
        <title>session</title>
    </head>
    <body>
        <?php
            echo $_SESSION['view'];
        ?>
    </body>
</html>

<?php
//    unset($_SESSION['view']);
//    session_destroy();
?>

 

posted on 2016-11-15 22:19  宝清老窖  阅读(102)  评论(0编辑  收藏  举报