Cześć, mam problem. Otóż przerabiam poradnik z internetu i coś mi nie idzie :/ nie wiem gdzie zrobiłem błąd.
Link do poradnika: https://www.youtube.com/watch?v=6q7ndD0rt2s
Kiedy nieuzupełnienie wszystkich komórek pojawia się ostrzeżenie, aby je uzupełnić. Uzupełniam je, wysyłam i nic. Mail nie dochodzi. Może ktoś wie w czym jest problem?
<?php
$to ='jakismail@gmail.com';
$subject = 'Wiadomość ze strony internetowej ';
$name =$_POST['name'];
$emial =$_POST['emial'];
$topic =$_POST['topic'];
$massage =$_POST['massage'];
$body = <<<EMAIL
Hi my name is $name,
and this is my massage $massage.
and my topic is $topic
EMAIL;
$headers = "From: $emial";
if($_POST){
if($name == '' || $email == '' || $massage == ''){
$feedback = 'Uzupełnij wszystkie komórki!';
}else{
mail($to , $subject, $body , $headers);
$feedback = 'Dziękuje za wysłanie maila';
}
}
?>
<! doctype html>
<html>
<head>
<meta charset="utf-8"/>
<link rel="stylesheet" href="main.css"/>
</head>
<body>
<div id="wrapper">
<div id="content">
<h2>Conect</h2>
<p id="feedback"><?php echo $feedback; ?></p>
<form action="?" method="post">
<ul>
<li>
<label for="name">Name:</label>
<input type="text" name="name" id="name">
</li>
<li>
<label for="emial">Emial:</label>
<input type="text" name="emial" id="emial">
</li>
<li>
<label for="topic">Topic:</label>
<select id="topic" name="topic">
<option value="ponies">Ponies</option>
<option value="mexcines">Mexcines</option>
<option value="winner">Winner</option>
</select>
</li>
<li>
<label for="massage">Massage:</label>
<textarea id="massage" name="massage" cols="50" rows="9"></textarea>
</li>
<li>
<input type="submit" value="Wyślij">
</li>
</ul>
</div>
</div>
</body>
</html>
body
{
background-color: blanchedalmond;
}
h2
{
text-align: center;
font-size: 2em;
}
form
{
width: 500px;
}
form ul
{
list-style-type: none;
}
form ul li
{
margin: 15px 0;
}
form label
{
display: block;
font-size: 1em;
}
form input, textarea, select
{
font-size: 1em;
padding: 5px;
border: 2px #ccc solid;
width: 100%;
}