Witam
Skorzystałem z poniższego skryptu PHP jak go zmodyfikować aby skrypt sprawdzał czy zostały zmienione domyśle pola value.
Jeżeli ich nie ma wszystko jest ok ale niestety musi tak zostać.
<?php
{
////////// USTAWIENIA //////////
$email = 'e-mail'; // Adres e-mail adresata
$subject = 'temat'; // Temat listu
$message = 'Dziękujemy za wysłanie formularza'; // Komunikat
$error = 'Wystąpił błąd podczas wysyłania formularza'; // Komunikat błędu
$charset = 'utf-8'; // Strona kodowa
//////////////////////////////
$head =
"MIME-Version: 1.0\r\n" .
"Content-Type: text/plain; charset=$charset\r\n" .
"Content-Transfer-Encoding: 8bit";
$body = '';
foreach ($_POST as $name => $value)
{
{
for ($i = 0; $i < count($value); $i++) {
}
}
}
}
else
{
?>
<form action="?" method="post" id="form"> <input type="text" id="name" name="name" value="Imię i Nazwisko:" onBlur="if(this.value=='') this.value='Imię i Nazwisko:';" onFocus="if(this.value=='Imię i Nazwisko:') this.value='';"/> <input type="text" id="phone" name="phone" value="Telefon:" onBlur="if(this.value=='') this.value='Telefon:';" onFocus="if(this.value=='Telefon:') this.value='';"/> <input type="text" id="mail" name="email" value="E-mail:" onBlur="if(this.value=='') this.value='E-mail:';" onFocus="if(this.value=='E-mail:') this.value='';"/> <input value="Wyczyść" class="button" name="reset" type="reset" /> <input value="Wyślij" class="button" name="submit" id="submit" type="submit" />
<?php
}
?>