Spam-o-Matic

0

<html>
<head><title>PHP Crash Course</title></head>
<body>
<h1>Spam-o-Matic</h1>

<?php

//if (isset(_POST['name']) ) {
if ($_SERVER["REQUEST_METHOD"] == "POST") {
echo "<p>Let's spam " . $_POST['name'] . " at " . $_POST['email']. ".<p/>" ;
echo "<p>Whom else shall we spam today?</p>" ;
} else {
echo "<p>Whom shall we spam today?</p>" ;
}

?>

<div style="float:left;">
<p>
<form name="test" id="test" method="POST">
<label for="name">Name:</label>
<input type="text" name="name" />
<br/>

<label for="email">Email:</label>
<input type="text" name="email" />
<br/>

<button type="submit" style="float:right; margin-top:0.3em;">Submit</button>
</form>
</p>
</div>

</body>
</html>