Skip to content

Instantly share code, notes, and snippets.

@peter279k
Created November 3, 2015 15:20
Show Gist options
  • Save peter279k/58ae9e73bbb0f58b913d to your computer and use it in GitHub Desktop.
Save peter279k/58ae9e73bbb0f58b913d to your computer and use it in GitHub Desktop.
<?php
if(empty($_POST['user_name']) || empty($_POST["password"]))
{
echo "invalid";
}
else
{
$people = 0;
if(!file_exists("people.txt"))
{
file_put_contents("people.txt", "0");
}
else
{
$people = (int)file_get_contents("people.txt");
$people = $people + 1;
@unlink("people.txt");
file_put_contents("people.txt", $people);
}
$user_name = $_POST['user_name'];
$password = $_POST['password'];
echo "you're No." . $people . "visits this web.";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment