Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $fn=fopen("count.txt","r");
- $count=fgets($fn);
- fclose($fn);
- $fn=fopen("count.txt","w");
- $reload=false;
- if(isset($_GET["reset"])&&$_GET["reset"]==="リセット"){
- $count=-1;
- $reload=true;
- }else if(isset($_GET["countdown"])&&$_GET["countdown"]==="カウントダウン"){
- $count-=2;
- $reload=true;
- }else{
- $count++;
- }
- fwrite($fn,$count);
- fclose($fn);
- if($reload==true){
- header("Location:count2.php?redilect=true");
- }
- ?>
- <h1>現在のアクセス回数<?php echo $count ?>回</h1>
- <form action="count2.php" method="GET">
- <input type="submit" name="reset" value="リセット">
- <input type="submit" name="countdown" value="カウントダウン">
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement