Autoincrement numeric variable in PHP on Refresh

前端 未结 4 1609
一生所求
一生所求 2021-01-24 08:56

How do I use PHP to auto-increment a numeric variable on page refresh?

Foe example, for $i=10 there is an output of this:

Page has be

4条回答
  •  余生分开走
    2021-01-24 09:30

    you need to store the counter somewhere like a file, database, cookie or session variable.

    
    
     1) {
            echo("This is visit number $visits.");
        } else { // First visit
            echo('Welcome to my Website! Click here for a tour!');
        }
    ?>
    

提交回复
热议问题