wkleilem, niezadzialalo, wywalilem
zrobilem jeszcze raz
WOW DZIALA!!!
brawo
czy nie bedzie problemow jezeli odbior poczty bedzie ustawiony tylko na txt a nie html?
czy ma to jakis zwiazek?
dziekuje wszystkim Wam za pomoc.
mam co potrzebuje
pozdrawiam
ps. polecam kazdemu na poczatek z phpem ten form. jest prosty i w jednym pliku
dziala w 100%
podaje caly kod juz po zmianach z tego postu:
<?php
// formularz z nie wypelnionym jakims polem po kliknieciu przycisku "send"
if ((empty($_POST['dno']) or
empty($_POST['name']) or
empty($_POST['email']) or
empty($_POST['country'])) and
!empty($_POST['submit'])) { // wyswietlamy formularz
echo "<table border=\"0\" width=\"680px\"><form method=\"post\"> <tr><td bgcolor=\"#A40233\" colspan=\"2\" align=\"center\"><font face=\"Verdana\" size=\"4\" color=\"#fff\">";
// lub w przypadku nie wypelnienia formularza do konca
echo "<strong>Fill in all fields!</strong></span>"; <tr>
<td><span style=\"color:#A40233;\"><strong> * </strong></span><tt>Your Distributor’s No:</tt></td>
<td><input type=\"text\" name=\"dno\" style=\"width: 410px\"></td>
</tr>
<tr>
<td><span style=\"color:#A40233;\"><strong> * </strong></span><tt> Your Name & Surname:</tt></td>
<td><input type=\"text\" name=\"name\" style=\"width: 410px\"></td>
</tr>
<tr>
<td><span style=\"color:#A40233;\"><strong> * </strong></span><tt> Your e-mail address:</tt></td>
<td><input type=\"text\" name=\"email\" style=\"width: 410px\"></td>
</tr>
<tr>
<td><span style=\"color:#A40233;\"><strong> * </strong></span><tt> Your Country:</tt></td>
<td><input type=\"text\" name=\"country\" style=\"width: 410px\"></td>
</tr>
<tr>
<td><span style=\"color:#A40233;\"><strong> * </strong><tt>field required</tt></span></td>
<td><input type=\"submit\" name=\"submit\" value=\"S e n d\" style=\"width: 200px; height: 24px\">
</form>
</tr>
<tr>
<td bgcolor=\"#A40233\" colspan=\"2\" align=\"center\"><font face=\"Verdana\" size=\"4\" color=\"#fff\">";
// lub w przypadku nie wypelnienia formularza do konca
echo "<strong>Fill in all fields!</strong></span>"; </tr>
</table>";
// formularz start glowny
}
elseif (empty($_POST['dno']) or
empty($_POST['name']) or
empty($_POST['email']) or
empty($_POST['country']) and
empty($_POST['submit'])) { // wyswietlamy formularz
echo "<table border=\"0\" width=\"680px\"><form method=\"post\"> <p>To request a copy of the price list please fill in Your Distributor’s No, Your Name & Surname and Your e-mail address and Country below.<br>We will send the price list via email during office opening hours.</p>
<tr>
<td bgcolor=\"#A40233\" colspan=\"2\" align=\"center\"><font face=\"Verdana\" size=\"2\" color=\"#fff\"><B>Request for Distributor`s Price List.</B></font></td>
</tr>
<tr>
<td><span style=\"color:#A40233;\"><strong> * </strong></span><tt>Your Distributor’s No:</tt></td>
<td><input type=\"text\" name=\"dno\" style=\"width: 410px\"></td>
</tr>
<tr>
<td><span style=\"color:#A40233;\"><strong> * </strong></span><tt> Your Name & Surname:</tt></td>
<td><input type=\"text\" name=\"name\" style=\"width: 410px\"></td>
</tr>
<tr>
<td><span style=\"color:#A40233;\"><strong> * </strong></span><tt> Your e-mail address:</tt></td>
<td><input type=\"text\" name=\"email\" style=\"width: 410px\"></td>
</tr>
<tr>
<td><span style=\"color:#A40233;\"><strong> * </strong></span><tt> Your Country:</tt></td>
<td><input type=\"text\" name=\"country\" style=\"width: 410px\"></td>
</tr>
<tr>
<td><span style=\"color:#A40233;\"><strong> * </strong><tt>field required</tt></span></td>
<td><input type=\"submit\" name=\"submit\" value=\"S e n d\" style=\"width: 200px; height: 24px\">
</form>
</tr>
<tr><td bgcolor=\"#a40233\" colspan=\"2\" align=\"center\"><font face=\"Verdana\" size=\"2\" color=\"#fff\"><B>Request for Distributor`s Price List.</B></font>
</table>";
}
// sprawdzamy, czy zmienne przeslane z formularza nie sa puste
elseif (!empty($_POST['dno']) && !empty($_POST['name']) && !empty($_POST['email']) && !empty($_POST['country'])) { // jeseli powyzszy warunek jest spelniony tworzona jest wiadomosc
// zmienna $message zawiera tresc wiadomosci
$message = "<b>Request for Distributor’s Price List</b><br /><br />Distributor’s No: $_POST[dno]<br />Name & Surname: $_POST[name]<br />e-mail: $_POST[email]<br />Country: $_POST[country]";
$header = "From: $_POST[name] <$_POST[email]>\n";
$header .="MIME-Version: 1.0\n";
$header .="Content-type: text/html; charset=utf-8\n";
// funkcja mail() za pomoca której wiadomosc zostanie wyslana
@mail("tu wstaw email ktory ma odebrac ten form","Request for Distributor’s Price List.","$message","$header") or
die('Message not sent!'); // wyswietlenie komunikatu w przypadku powodzenia
echo "<div align=\"center\"><span style=\"color:#A40233;\"><strong>Your Request for Distributor’s Price List SENT!<br>Thank you.<br>The Pricelist will be send to your email during office opening hours.</strong></span></div>"; }
?>
DZIEKI