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.
<form method="POST" action="">
Поле 1 - <input type="text" name="input1"><br /><br />
Поле 2 - <input type="text" name="input2"><br /><br />
<input type="submit" name="submit" value="Добави">
</form>
<?
if (isset($_POST['submit']))
{
$input1=$_POST['input1'];
$input2=$_POST['input2'];
if (empty($input1) || empty($input2))
{
echo "Попълнете полетата";
}
else
{
$file="file.txt";
if (!file_exists($file))
{
touch($file);
echo "Файла не съществуваше, затова беше създаден, моля рефрешнете !";
}
else
{
$op=fopen($file, "w+");
fputs($op, "От поле 1 - $input1 / От поле 2 - $input2\n");
fclose($op);
}
}
}
?>
<form method="POST" action="">
Поле 1 - <input type="text" name="input1"><br /><br />
Поле 2 - <input type="text" name="input2"><br /><br />
<input type="submit" name="submit" value="Добави">
</form>
<?
if (isset($_POST['submit']))
{
$input1=$_POST['input1'];
$input2=$_POST['input2'];
if (empty($input1) || empty($input2))
{
echo "Попълнете полетата";
}
else
{
$name=rand(000, 999999);
$format=".txt";
$file=$name.$format;
if (!file_exists($file))
{
touch($file);
$op=fopen($file, "w+");
fputs($op, "От поле 1 - $input1 / От поле 2 - $input2\n");
fclose($op);
echo "Всичко премина оспешно, <b>МОЛЯ НЕ РЕФРЕШВАЙТЕ СТРАНИЦА, ЗАЩОТО ЩЕ ДОБАВИ НОВ ФАЙЛ !!</b> <a href='index.php'>Начало</a>";
}
else
{
$op=fopen($file, "w+");
fputs($op, "От поле 1 - $input1 / От поле 2 - $input2\n");
fclose($op);
}
}
}
?>
<form method="POST" action="">
Име - <input type="text" name="username"><br /><br />
Парола - <input type="password" name="password"><br /><br />
Имейл - <input type="text" name="email"><br /><br />
<input type="submit" name="submit" value="Добави">
</form>
<?
if (isset($_POST['submit']))
{
$username=htmlspecialchars($_POST['username']);
$password=htmlspecialchars($_POST['password']);
$email=htmlspecialchars($_POST['email']);
if (empty($username) || empty($password) || empty($email))
{
echo "Попълнете полетата";
}
else
{
$file=$username;
$format=".txt";
if (!file_exists($file.$format))
{
touch($file.$format);
$op=fopen($file.$format, "w+");
fputs($op, "Име - $username\n Парола - $password\n Имейл - $email\n");
fclose($op);
echo "Потребител с име $username беше регистриран успешно ! <a href='index.php'>Начало</a>";
}
else
{
echo "Този потребител вече е бил регистриран !";
}
}
}
?>