ma ktoś pomysł jak rozwiązać problem kodowania? bo zrobiłem coś takiego, kodowanie działa lecz niestety nie pokazuje nadawcy nie wiem czemu, pokazuje że nadawca jest nieznany...
<?php
if (isset($_POST['submit'])) { $output_form = false;
$headers[] = "MIME-Version: 1.0";
$headers[] = "Content-type: text/plain; charset=utf-8";
$headers[] = "From: $email";
$email_to = "kafar610@gmail.com";
$email_subject = "Your email subject line";
$nick = $_POST['nick'];
$email = $_POST['email'];
$telephone = $_POST['telephone'];
$other = $_POST['other'];
echo 'nie podałeś imienia i nazwiska<br />'; $output_form = true;
}
echo 'nie podałeś emaila<br />'; $output_form = true;
}
echo 'nie zadałeś pytania<br />'; $output_form = true;
}
}
$msg = "Imię i nazwisko: $nick\n" .
"Telefon: $telephone\n" .
"Pytania, uwagi: $other";
mail($email_to, $email_subject, $msg, implode("\r\n", $headers)); echo 'Wysłano e-mail, dziękujemy <br />'; }
else{
$output_form = true;
}
if ($output_form) { // sprawdza wartosc zmiennej $output_form jesli true to wyswietla formularz
?>
<form name="contactform" method="post" action="
<?php echo $_SERVER['PHP_SELF']; ?>">
<table width="750px" cellspacing="10">
<tr>
<td valign="top">
<label for="nick">Imię i nazwisko <font color="red">*</font></label>
</td>
<td valign="top">
<input type="text" name="nick" maxlength="50" value="
<?php echo $nick; ?>" size="30">
</td>
</tr>
<tr>
<td valign="top">
<label for="email">Adres e-mail <font color="red">*</font></label>
</td>
<td valign="top">
<input type="text" name="email" maxlength="80" value="
<?php echo $email; ?>" size="30">
</td>
</tr>
<tr>
<td valign="top">
<label for="telephone">Numer telefonu</label>
</td>
<td valign="top">
<input type="text" name="telephone" maxlength="30" value="
<?php echo $telephone; ?>" size="30">
</td>
</tr>
<tr>
<td valign="top">
<label for="other">Pytania, uwagi <font color="red">*</font></label>
</td>
<td valign="top">
<textarea name="other" maxlength="1000" cols="25" rows="6">
<?php echo $other; ?></textarea>
</td>
</tr>
<tr>
<td colspan="2" style="text-align:center">
<input type="submit" name="submit" value="Submit">
</td>
</tr>
</table>
</form>
<?php
}
?>
Ten post edytował kafar610 27.03.2014, 14:46:28