Skryp wysyłający:
if (($_REQUEST['name'] == "")) {
if(empty($_REQUEST['asunto'])) { }
if ($_REQUEST['EMail'].length > 1){
if ( ! preg_match('/^[a-z0-9_\.\-]+@[a-z0-9\.\-]+\.[a-z]{2,}$/i', $_REQUEST['EMail']) ) die ("Your mails format is not valid"); }
if ( preg_match("/!/", $_REQUEST['EMail'] ) ) die ("Your mail address is not valid");
if ( strstr($_REQUEST['EMail'], "\n") ) die ("Your mails format is not valid"); $nowUrl = $_SERVER['HTTP_REFERER']; //woher kommt der aufruf
// SENDMAIL /////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
if(empty($_REQUEST['asunto'])) { }
$my_email = "karkonosze@promax.media.pl";
$continue = "/";
// This line prevents values being entered in a URL
if ($_SERVER['REQUEST_METHOD'] != "POST"){exit;} $message = "";
// This line prevents a blank form being sent
while(list
($key,$value) = each($_REQUEST)){ if(!(empty($value))){$set=1;}
if((!($key == "name")) AND (!($key == "goto")) AND (!($key == "goto1")) AND (!($key == "goto2")) ){
//$message = $message . "$key: $value\n";
}
}
$message = $message .
"CONSULTA > " . $_REQUEST['asunto'] . "\n" .
"-----------------------------------------------\n" .
"Apellidos: " . $_REQUEST['Apellidos'] . "\n" .
"Nombre: " . $_REQUEST['Nombre'] . "\n" .
"email: " . $_REQUEST['EMail'] . "\n" .
"Mensaje: " . $_REQUEST['mensaje']
;
if($set!==1
){header("location: $_SERVER[HTTP_REFERER]");exit
;} //$message = $message . "-- \n";
$message = stripslashes($message); // do not change name message - is used in leveltest $subject = "Web: CONSULTA > " . $_REQUEST['asunto'];
$headers = "From: " . "web" . "\n" . "Return-Path: " . $_REQUEST['EMail'] . "\n" . "Reply-To: " . $_REQUEST['EMail'] . "\n";
mail($my_email,$subject,$message, "From: " . $_REQUEST['EMail']);
// BB.DD. ///////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
//$db = @mysql_connect("localhost","c_kipke","Ei6faash");
//if (!$db) {
// echo "Your message has been sent.<br><br>Please use the back-button of your browser. <br><br>Thank you.\n";
// exit;
//}
//mysql_select_db("c_kipke_db_1",$db);
$Email = $_REQUEST['EMail'];
$Name = $_REQUEST['Apellidos'] . ", " . $_REQUEST['Nombre'];
$Asunto = $_REQUEST['asunto'];
$Text = $message;
$sql = "INSERT INTO ContactosViaForm (Date,Name,Email,Topic,Text) VALUES ('$dat','$Name','$Email','$Asunto','$Text')";
// OK /// ///////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
header('Location:' . $_REQUEST['goto']);
}
Formularz wysyłający:
Kod
<FORM action="consulta.php" method="post" name="consulta">
<h1><img src="datos/flecha_submenu.gif">Skontaktuj się z nami</h1>
<p>Jesteśmy zadowoleni, mogąc pomóc Ci w wyborze kursu języka hiszpańskiego, który jest odpowiedni dla Ciebie. Jesteśmy tu, aby pomóc Ci w pełni wykorzystać możliwości nauki języka hiszpańskiego w Hiszpanii.</p>
<table width="100%" border="0" cellpadding="2" cellspacing="2" class="inscripcion_tabla">
<tr>
<td class="inscripcion_izq">Nazwisko:</td>
<td><input type="text" name="Apellidos" size="32"></td>
</tr>
<tr>
<td class="inscripcion_izq">Imię:</td>
<td><input type="text" name="Nombre" size="32"></td>
</tr>
<tr>
<td class="inscripcion_izq">E-mail:</td>
<td><input type="text" name="EMail" size="32"></td>
</tr>
<tr>
<td class="inscripcion_izq">Temat:</td>
<td><select name="asunto">
<option selected value="Alojamiento">Zakwaterowanie</option>
<option value="Precios">Cena</option>
<option value="Cursos de Español">KURS HISZPAŃSKIEGO</option>
<option value="Español para el turismo">Hiszpański dla turystyki</option>
<option value="Inscripción">Rejestracja</option>
<option value="Actividades">Dodatkowe zajęcia</option>
<option value="Otros">Inne</option>
</select></td>
</tr>
<tr>
<td class="inscripcion_izq">Wiadomość:</td>
<td><textarea name="mensaje" cols="50" rows="3"></textarea></td>
</tr>
</table>
<div class="inscripcion_separador"></div>
<p align="center">
<input type="HIDDEN" name="name" size="8" maxlength="20" value="" />
<br>
<input type="submit" value="Wyślij" name="Submit_Spanish" style="width:250px; margin-top:6px; margin-bottom:12px"><br>
<a href="java script:document.consulta.reset();">Skasuj zawartość formularzu</a> <br>
<!--<input type="HIDDEN" name="asunto" value="CONSULTA"><br> -->
<input type="HIDDEN" name="goto" value="escuela_contactar_ok_pl.php">
</p>
</form>
Klikam wyślij, nie waliduje ani nie wysyła.
Anyone help. (IMG:
style_emoticons/default/smile.gif)