Cześć, może ktoś wie w czym jest problem.
Dostaję takie powiadomienie
Notice: Undefined index: name in G:\Programy\XAMPP\htdocs\Formularz\index.php on line 11
Notice: Use of undefined constant wszystko_OK - assumed 'wszystko_OK' in G:\Programy\XAMPP\htdocs\Formularz\index.php on line 19
udana walidacja
<?php
session_start();
if (isset($_POST['email']))
//Udana walidacja.
$wszystko_OK=true;
//Sprawdzenie poprawnosci name
$name = $_POST['name'];
//Sprawdzenie długości name
if((strlen($name)<3) || (strlen($name)>20))
{
$wszystko_OK=false;
$_SESSION['e_nick']="Imie jest zbyt krótkie";
}
if(wszystko_OK==true)
{
echo "udana walidacja";
exit();
}
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Formularz Kontaktowy - Tytuł naszej strony</title>
<link rel="stylesheet" href="style.css"/>
<style>
.e_nick
{
color: red;
}
</style>
</head>
</body>
<form action="kontakt.php" method="POST" id="myForm">
<input type="text" name="name" placeholder="Imię i nazwisko">
<?php
if(isset($_SESSION['name']))
{
echo '<div class="e_nick">'.$_SESSION['e_nick'].'</div>';
unset ($_SESSION['e_nick']);
}
?>
<input type="email" name="email" placeholder="Adres e-mail" >
<input type="text" name="telefon" placeholder="Adres telefon">
<textarea class="wiadomosc"name="your-message" placeholder="Treść wiadomości"></textarea>
<button type="submit">Wyślij</button>
</form>
<body>
</html>