Skip to content

Commit 051657f

Browse files
author
FungY911
committed
Initial commit
0 parents  commit 051657f

File tree

129 files changed

+104178
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+104178
-0
lines changed

.fleet/settings.json

Whitespace-only changes.

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 FungY911
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

api/getUsers/UsersCount

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
8

api/getUsers/index.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
// Set the name of the cookie
3+
$cookieName = 'UsersCount';
4+
5+
// Check if the cookie is set
6+
if (!isset($_COOKIE[$cookieName])) {
7+
// The cookie is not set, so this is a new user
8+
$storage_num = 0;
9+
// Increment the counter
10+
$storage_num = file_get_contents('UsersCount');
11+
$storage_num++;
12+
file_put_contents('UsersCount', $storage_num);
13+
14+
// Set the cookie
15+
setcookie($cookieName, 1, time() + (86400 * 31), '/'); // 86400 = 1 day
16+
if ($_GET['traffic'] == 'show') { echo file_get_contents('UsersCount'); } else { echo('An error occured.');}
17+
} else {
18+
// The cookie is set, so this is not a new user
19+
if ($_GET['traffic'] == 'show') { echo file_get_contents('UsersCount'); } else { echo('An error occured.'); }
20+
}

0 commit comments

Comments
 (0)