dzieki, niestety po
dwukrotnym blednym wywolaniu formularza dostaje biala strone bez tla juz, poniewaz po pierwszym przeslaniu formularza polu submit nie ma juz zdarzenia onclick w JS wiec nastepuje normalne przeslanie formularza... jak temu zaradzic?
aktualny stan plikow:
form.html:
Kod
<p class="para">Czekam na pytania, uwagi, sugestie dot. strony i Isengard.
<form action="send.php" method="post" id ="the_form">
<table cellspacing="0" cellpadding="1" border="0" align="center" width="95%">
<tr>
<td width="20%" valign="bottom" nowrap>
<p align="right" class="para">temat:</p>
</td>
<td width="80%" align="left">
<input type="text" size="30" maxlength="50" name="temat" style="width:200px;">
</td>
</tr>
<tr>
<td width="20%" valign="bottom" nowrap>
<p align="right" class="para">e-mail nadawcy:</p>
</td>
<td width="80%" align="left">
<input type="text" size="30" maxlength="50" name="email" style="width:200px;">
</td>
</tr>
<tr>
<td width="20%" valign="bottom" nowrap class="underline">
<p align="right" class="para">treść wiadomości:<br><br><br><br><br><br><br><br><br><br></p>
</td>
<td width="80%" align="left" class="underline">
<textarea name="tresc" style="width:431px; " rows="10" cols="50"></textarea>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<input type="submit" name="submit" value="wyślij" /> <INPUT TYPE="reset" VALUE="wyczyść">
</td>
</tr>
</table>
</form>
mail.php:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Language" content="pl">
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-2">
<link rel="stylesheet" href="style.css" type="text/css">
<title>kontakt via e-mail</title>
<script type="text/javascript" src="advajax.js"></script>
<script type="text/javascript">
function sprawdz() {
advAJAX.assign(document.getElementById("the_form"), {
onSuccess : function(obj) {
var element = document.getElementById("wynik");
element.innerHTML = obj.responseText;
},
headers : {
"content-type" : "text/html; charset=iso-8859-2",
"content-language" : "pl"
}
});
return false;
}
</script>
</head>
<body bgcolor="black" onload="sprawdz()"><br>
<div id = "wynik">
<?php include('form.html'); ?>
</div>
<p class="para" align="left"> <a href="javascript:window.close();" class="genmed">Zamknij Okno</a></p>
</body>
</html>
send.php
<?php
header('Content-type: text/html; charset=iso-8859-2');
#Pobieranie adresu IP
$ip=$_SERVER['REMOTE_ADDR'];
#Pobieranie serwera
$host=gethostbyaddr($ip);
#Pobieranie adresu strony
$document=$_SERVER['HTTP_REFERER'];
# temat
if (empty($_POST['temat'])) { $te = FALSE;
$message .= 'Zapomnia�e� poda� temat wiadomo�ci.' . '<br />';
$bg[1] = ' background-color: #C0C0C0; color: black';
} else {
$te = $_POST['temat'];
}
# e-mail
if ( !(strstr($_POST['email'], '@')) || strlen($_POST['email'])<6
) { $em = FALSE;
$message .= 'Popraw sw�j adres e-mail.' . '<br />';
$bg[2] = ' background-color: #C0C0C0; color: black';
} else {
$em = $_POST['email'];
}
# tresc
if (empty($_POST['tresc'])) { $tr = FALSE;
$message .= 'Zapomnia�e� poda� tre�� wiadomo�ci.' . '<br />';
$bg[3] = ' background-color: #C0C0C0; color: black';
} else {
$tr = $_POST['tresc'];
}
if ($te && $em && $tr) {
$wiadomosc = "
Wiadomo�� od $em: <br/><br/>
$tr <br/><br/>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- <br/>
IP nadawcy: $ip <br/>
HOST nadawcy: $host <br/>
wys?ano z: $document <br/>
";
$naglowki = "MIME-Version: 1.0r\n";
$naglowki .= "Content-type: text/html; charset=iso-8859-2r\n";
$naglowki .= "From: $emr\n";
if ( mail('test@test.pl',$te,$wiadomosc,$naglowki) ) { echo '<div align="center"><p class="para"><b>Wiadomo�� wys�ana.</b></p></div>';
} else { echo 'Wiadomo�� nie mog�a zosta� wys�ana z przyczyn technicznych.'; }
} else {
echo '<div align="center"><p class="error">'; }
echo '<br /><b>Spr�buj jeszcze raz.</b>'; include('form.html');
}
?>