PHP code:
<html>
<head>
<head>
</head>
<body bgcolor="000033" text="navy">
<?php
$nume="";
$email="";
$subiect="";
if (!$nume || !$email || !$subiect)
{
?>
<h4 style="color:gray" align="center">
Eroare: Toate campurile sunt obligatorii!</h4>
<p align="center">
Corectati <a href="javascript:history.go(-1)">formularul</a>
</p>
<?
}
else{
?>
<h4 style="color: green;" align="center">
Formularul introdus </h4>
<hr size="1" width="75%">
<?
$mesaj = "";
$mesaj .= "<impresie data=\"". date("d M Y, G:i");
$mesaj .= "\" client = \"" . $REMOTE_HOST . "(" . $REMOTE_ADDR . ")\">
";
$mesaj .= "<nume email=\"" . $email . "\">" . $nume . "</nume>
";
if ($subiect)
$mesaj .= "<text>
" . $subiect . "
</text>
</subiect>
";
mail("sitecurs18@gmail.com", "subiect", $mesaj, "from:". $email);
}
?>
<hr size="1" width="75%">
</body>
</html>
Form code:
<html>
<head>
<title>Contact</title>
<style type="text/css">
body {background-color: 000033;
}
table {margin-top: 10px;}
</style>
</head>
<body>
<form action="prelucrare.php">
<table width="800" align="center" rows="5" cols="3" cellspacing="0" border="0">
<tr>
<td bgcolor="gray" colspan="3"><font face="serif" color="000033" size="+3">Contact</font></td>
</tr>
<tr>
<td width="175" height="65" align="left" valign="center"><font face="arial" color="gray"size="3"><p>Numele şi prenumele:</p></font></td>
<td width="225" align="left" valign="center"><input name="nume" type="text" value=""></td>
</tr>
<tr>
<td height="65"><font face="arial" color="gray" size="3"><p>Adresa e-mail:</p></font></td>
<td><input name="email" type="text" value=""></td>
</tr>
<tr>
<td height="65"><font face="arial" color="gray" size="3"><p>Subiect:</p></font></td>
<td><textarea rows="6" cols="40" name="subiect"></textarea></td>
</tr>
<tr>
<td height="65" align="right"><input type="submit" value="Trimite"></td>
<td align="center"><input type="reset" value="Şterge"></td>
</tr>
</table>
</form>
</body>
</html>
When i submit the form it takes me straight to the error page saying I didn't fill in all the fields,I tried everything but couldn't fix it.
I've tried defining the variables for the fields as empty,but it changed nothing,and also tried changing the php tags from