<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN">
<html>
<head>
	<title>Gardiol @ Org - Contact the webmaster (Willy Gardiol)</title>
</head>
<body>
<?php
$valid = false;

if ( (isset($_POST["putty"]) && ($_POST["putty"] != "") ) &&
     (isset($_POST["putty"]) && ($_POST["potty"] != "") ) &&
     (isset($_POST["putty"]) && ($_POST["patty"] != "") ) )
	$valid = true;

if ( isset($_POST["username"]) && ($_POST["username"] != "" ) )
	$valid = false;

if ( !$valid )
{
?>
<p><i>Note: </i><b>*</b> are required fields!</p>
<form action="https://www.gardiol.org/contact.php" 
      method="post">
<input type="text" style="display: none" name="username" />
<fieldset>
	<legend for="username">Your name*</legend>
	<input type="text" value="" name="putty"/>
</fieldset>
<fieldset>
	<legend for="potty">Your email address*</legend>
	<input type="text" value="" name="potty"/>
</fieldset>
<fieldset>
	<legend for="patty">Your message*</legend>
	<textarea style="width: 90%" name="patty">Please enter here your message!</textarea>
</fieldset>
<button type="submit" name="submit" value="submit">
	Submit contact!
</button>
</form>
<?php
}
else
{
$to = "Willy Gardiol <willy@gardiol.org>";
$subject = "Contatto: (from web) ".$_POST["putty"]." <".$_POST["potty"]."> ";
$headers = "From: ".$_POST["potty"]."\r\n";
$headers .= "X-Mailer: php";
$body = $_POST["patty"];
mail( $to, $subject, $body, $headers );
?>
<div id="email_sent"><p>Email send to webmaster! Thank you.</p></div>
<a href="https://www.gardiol.org">back to home</a>
<?php
}
?>
</body>
</html>
