Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
<?php
if(!isset($_POST['submit'])) {
$key = rand(0,Z); // За това не съм сигурен!
$self = $_SERVER['PHP_SELF'];
echo $key;
print "<form method='post' action='".$self."'><input type='hidden' name='key' value='".$key."'><input type='text' name='submittedkey'><input type='submit' name='submit' value='Go!'></form>";
}
else {
$getKey = $_POST['submittedkey'];
$OrigKey = $_POST['key'];
if($getKey == $OrigKey) {
header("Location: STRANICA.php");
}
else {
print "Key`s not equal!";
}
}
?>
<?php
session_start();
$kod = $_POST['kod'];
if (empty($kod))
{
$rand = rand('1000', '9999');
$_SESSION['rand'] = $rand;
echo "<div align=center>
<form name=form1 method=post action=>
$rand<br>
<input name=kod type=text id=kod>
<input type=submit name=Submit value=Давай>
</form>
</div>";
}else
{
$rand = $_SESSION['rand'];
if ($rand == $kod)
{
$_SESSION['ok'] = "1";
echo '<meta http-equiv="refresh" content="0;URL=stranica.php">';
}else
{
echo '<meta http-equiv="refresh" content="0;">';
}
}
?>
<?php
session_start();
$ok = $_SESSION['ok'];
if ($ok != "1")
{
echo "<center><h1><b>НЯМАШ ДОСТЪП</b></h1></center>";
exit;
}
echo "<center><h1><b>ИМАШ ДОСТЪП</b></h1></center>";
?>