Am facut si eu un formular..si nu imi merge..am nevoie urgent
contact.php
PHP Cod:
<?php
// header and footer
$headerFile = "header.htm";
$footerFile = "footer.htm";
include($headerFile);
?> <center>
<table border="2" width="684" style="border-style: dotted; border-width: 1px" bgcolor="#CC3300">
<tr>
<td><form action="trimite.php" method="post">
<table border="0">
<tr><td><strong>Email: </strong></td><td><input type="text" name="email" value="" /></td></tr>
<tr><td><strong>Nume: </strong></td><td><input type="text" name="nume" value="" /></td></tr>
<tr><td><strong>Prenume:</strong></td><td><input type="text" name="prenume" value="" /></td>
</tr><tr><td><strong>Subiect: </strong></td><td><input type="text" name="subiect" value="" /></td></tr>
<tr><td><strong>Mesaj:</strong></td><td><textarea name="mesaj" cols="40" rows="20"></textarea></td></tr>
<tr><td><input type="submit" name="Trimite" value="Trimite" /></td></tr>
</table>
</form>
</td>
</tr>
</table>
</center> <?php
//
// INCLUDE FOOTER FILE
//
include($footerFile);
?>
trimite.php
PHP Cod:
<?php
// header and footer
$headerFile = "header.htm";
$footerFile = "footer.htm";
include($headerFile);
?><table border="2" width="684" style="border-style: dotted; border-width: 1px" bgcolor="#CC3300">
<tr>
<td>?> <center>
if(($_POST['email'] == '') || ($_POST['nume'] == '') || (is_numeric($_POST['nume'])) || ($_POST['prenume'] == '') || (is_numeric($_POST['prenume'])) || ($_POST['subiect'] == '') || ($_POST['mesaj'] == '')) {
echo '<b>Completati campurile corect <br>
Apasati <a href="contact.php">AICI</a> pentru a va intoarce la pagina de contact.</b>';
} else {
$catre = 'mr_0riginality@yahoo.com'; //
$data_trimitere = date('d-m-Y H:i:s');
$subiect = $_POST['subiect'];
$mesaj = '
<html>
<head>
<title>Aici ne puteti contacta in legatura cu site'ul nostru ! </title>
</head>
<body>
<p><tt>Data trimitere: '.$data_trimitere.' </tt></p>
<table>
<tr>
<td><tt> Nume: '.$_POST['nume'].' </tt></td>
</tr>
<tr>
<td><tt> Prenume: '.$_POST['prenume'].' </tt></td>
</tr>
<tr>
<td><tt> E-Mail: <a href="mailto:'.$_POST['email'].'">'.$_POST['email'].'</a> </tt></td>
</tr>
<tr>
<td><tt> Mesaj: <br><br> '.$_POST['mesaj'].' </tt></td>
</tr>
</table>
</body>
</html>';
$headere = "MIME-Version: 1.0\r\n";
$headere .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headere .= "From: ".$_POST['nume']." ".$_POST['prenume']."<".$_POST['email'].">\r\n";
mail($catre, $subiect, $mesaj, $headere);
echo '<font color="blue"><b>Mesaj Trimis</b></font><br>';
echo '<b>Apasati <a href="contact.php">AICI</a> pentru a va intoarce la pagina de contact.</b>';
}
</center> <?php</td>
</tr>
</table>
//
// INCLUDE FOOTER FILE
//
include($footerFile);