<!-- ***** Note: this code can go anywhere in your interface, it is a stand alone table. You have to save it with the .php extension, and it can only be tested live on your server. Your server has to have php enabled. Some Microsoft servers only allow ASP.******-->
<h1 align="center" class="journalheader">Contact me</h1>

<!-- ***************begin php content *************-->
/*on the mac, the red error messages are right over the entry boxes, for mac's sake

need to position them off the right side of the boxes. */

$sender_name = stripslashes($_POST[sender_name]);
$sender_email = stripslashes($_POST[sender_email]);
$message = stripslashes($_POST[message]);
$form_block = "
<table width=\"450\" border\"1\" cellpadding=\"10\" cellspacing=\"0\"><tr><td>
<form method=\"post\" action=\"$_SERVER[PHP_SELF]\">
<fieldset><legend>Send Mark an email:</legend>
<p>If you prefer, you can <a title=\"I have spam proofed this email address. You will need to edit the address when your email software opens.\" href=\"mailto:elvis@*REMOVE*graceland.com\">email Mark</a> directly without using the form below.</p>
<p><b>Your name:</b><br />
<input type=\"text\" name=\"sender_name\" size=\"40\" value=\"$sender_name\" class=\"inputty\"></p>

<p><b>Your email address:</b><br />
<input type=\"text\" name=\"sender_email\" size=\"40\" value=\"$sender_email\" class=\"inputty\"></p>

<p><b>Message:</b><br />
<textarea name=\"message\" rows=\"15\" style=\"width: 400px; height: 220px\" cols=\"35\" wrap=\"virtual\" class=\"inputty\">$message</textarea></p>

<input type=\"hidden\" name=\"operation\" value=\"dosomething\">
<p><input type=\"submit\" name=\"submit\" value=\"send this form\"></p>

if ($_POST[operation] != "dosomething") {
//they need to see the form
/* $sender_name = stripslashes($_POST[sender_name]);
$sender_email = stripslashes($_POST[sender_email]);
$message = stripslashes($_POST[message]);*/
echo "$form_block";
} else if ($_POST[operation] == "dosomething") {
if ($_POST[sender_name] == "") {
$name_err = "<div id=\"Layer1\" style=\"position:absolute; width:228px; height:20px; z-index:1; left: 295px; top: 257px;\" class=\"red\">* Please enter your name!</div>";
$send = "no";

if (!eregi('^[a-zA-Z0-9_\-\.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$', $_POST[sender_email])) {
$email_err = "<div id=\"Layer2\" style=\"position:absolute; width:228px; height:40px; z-index:1; left: 320px; top: 299px;\" class=\"red\">* Please enter a valid<br />&nbsp;&nbsp; email address!</div>";
$send = "no";
if ($_POST[message] == "") {
$message_err = "<div id=\"Layer3\" style=\"position:absolute; width:228px; height:30px; z-index:1; left: 255px; top: 373px;\" class=\"red\">* Please enter your message!</div>";
$send = "no";
if ($send != "no") {
//it's ok to send!
/*$sender_name = stripslashes($_POST[sender_name]);
$sender_email = stripslashes($_POST[sender_email]);
$message = stripslashes($_POST[message]);*/
$to = "elvis@graceland.com"; //**********put your email address here instead of mine!*******************
$subject = "message from the form on my website";
$mailheaders = "From: $sender_email \n"; //**********adds the senders email address to the from line*******************
$mailheaders .= "Reply-To: $sender_email\n\n";
$msg = "e-mail sent from form at websterart\n"; //**********put your web site address here instead of mine!*******************
$msg .= "Sender's Name: $sender_name\n";
$msg .= "Sender's e-mail: $sender_email\n";
$msg .= "Message: $message\n\n";
mail($to, $subject, $msg, $mailheaders);
echo "<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Here is what you wrote: <br />
<div class=\"dotted\">
<b>Your Name:</b> $sender_name<br />
<b>Your Email Address:</b> $sender_email<br />
<b>Your Message:</b><br />

<br /><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I will reply shortly, thanks <b> $sender_name </b><br /><br /><br />
} else if ($send == "no"){
echo "$name_err";
echo "$email_err";
echo "$message_err";
echo "$form_block";


<!--********************end php content back to my contact page.***********************-->