<?PHP

   // MailForm v0.03
   // 4th June 2001; revised 2002/05/01; revised 2003/06/11
   // By Rick Murray.
   //
   // This is an only-slightly-modified version of RickMail (mailme.php3)
   //
   //
   // On entry:
   //   who = The name of the person we are sending an email to
   //   eml = The email address (without domain) of this person (must be at heyrick)
   //   whr = The link back
   //   whd = The description of the link back (ie, "Return to main index")
   //
   // To use, simply do something like:
   //   <a href="mailform.php3?who=Their+name&eml=emailaddress&whr=index.html&whd=Main+Index">
   //   some sort of blurb</a>
   //

   if (($who == "") || ($eml == ""))
   {
      echo("<!doctype html public \"-//W3C//DTD HTML 3.2//EN\">\n\n");
      echo("<html>\n");
      echo("<head>\n");
      echo("<title>Mail handler error</title>\n");
      echo("</head>\n\n\n");
      echo("<!--  /php3/mailform.php3 [input invalid]-->\n");
      echo("<!--                                     -->\n");
      echo("<!--  (C) Copyright 2003 Richard Murray  -->\n");
      echo("<!--  Designed by Richard Murray         -->\n");
      echo("<!--  rmurray@heyrick.co.uk              -->\n");
      echo("<!--                                     -->\n");
      echo("<!--  This page is auto-generated.       -->\n\n");
      echo("<body bgcolor=\"#f0f0f0\" text=\"#000000\" link=\"#0022dd\" vlink=\"#002288\">\n\n");
      echo("<h1 align = \"center\">Mail handler error</h1>\n\n");
      echo("Use:\n<pre>  /php3/mailform.php3?who=WWW&eml=XXX&whr=YYY&whd=ZZZ</pre>\n<p>\n\n");
      echo("Where...\n");
      echo("<pre>  who = The name of the person we are sending an email to\n");
      echo("  eml = The email address (without domain) of this person (must be at heyrick)\n");
      echo("  whr = The link back\n");
      echo("  whd = The description of the link back (ie, \"Return to main index\")</pre>\n");
      echo("<p>\n\n");
      echo("Like...\n");
      echo("<pre>  &lt;a href=\"mailform.php3?who=Their+name&eml=emailaddress&whr=index.html&whd=Main+Ind\nex\"&gt;some sort of blurb&lt;/a&gt;</pre>\n<p>&nbsp;<p>\n\n\n");

      $referer = getenv("HTTP_REFERER");
      if ($referer != "")
      {
         echo("<hr size = 3>\n");
         echo "<a href=\"$referer\">Go back to the referring page</a>\n";
      }

      echo("<hr size = 3>\n");
      echo("<address>Script &copy; 2003 Richard Murray</address>\n");
      echo("</body>\n");
      echo("</html>\n");
      exit();
   }

   // HEADER
   echo("<!doctype html public \"-//W3C//DTD HTML 3.2//EN\">\n\n");
   echo("<html>\n");
   echo("<head>\n");
   echo("<title>Mail $who</title>\n");
   echo("</head>\n\n\n");
   echo("<!--  /php3/mailform.php3                -->\n");
   echo("<!--                                     -->\n");
   echo("<!--  (C) Copyright 2003 Richard Murray  -->\n");
   echo("<!--  Designed by Richard Murray         -->\n");
   echo("<!--                                     -->\n");
   echo("<!--  This page is auto-generated.       -->\n\n");
   echo("<body bgcolor=\"#f0f0f0\" text=\"#000000\" link=\"#0022dd\" vlink=\"#002288\">\n\n");
   echo("<h1 align = \"center\">Mail $who</h1>\n\n");
   echo("<p>\n\n");

   // MESSAGES
   echo("<h2>Important</h2>\n\n");
   echo("I have moved to France, so no email can be dealt with.\n");
   echo("I will not be returning to the UK.<br>\n");
   echo("Unfortunately, I do not have email facilities in France. However, if you have my\n");
   echo("postal address, feel free to drop me a line. It's nice to read something in\n");
   echo("English once in a while! <tt>:-)</tt><p>\n\n");
   echo("You can try sending me email, but <i>I cannot guarantee I'll be able to pick it");
   echo(" up.</i>\n");
   echo("Sorry for this.\n");
   echo("<p>&nbsp;<p>\n\n\n");

   // MAILTO LINK
   echo("<h2>Standard email</h2>\n\n");
   echo("You can send an email with your normal mail software by using this address...");
   echo("<br>\n");
   echo("<ul><li> $eml(at)heyrick.co.uk</ul>\n");
   echo("<p>&nbsp;<p>\n\n\n");

   // RICKMAIL
   echo("<h2>RickMail</h2>\n\n");
   echo("Or, you can try sending a <i>short</i> message right here by filling in the form\n");
   echo("below and then clicking <i>Send</i>...\n");
   echo("<p>\n\n");
   echo("<center>\n");
   echo("<form method=\"get\" action=\"http://www.heyrick.co.uk/php3/rickmail.php3\">\n");
   echo("  <input type=\"hidden\" name=\"to\" value=\"" . $eml . "\">\n");
   echo("  <input type=\"hidden\" name=\"back\" value=\"" . $whr . "\">\n");
   echo("  <table border=\"0\" cellpadding=\"2\" cellspacing=\"0\">\n");
   echo("    <tr align=center>\n");
   echo("      <td colspan=6 bgcolor=\"#000088\"><font color=\"#ffff00\">");
   echo("      <b>Send an email to <i>" . $who . "</i><b></td><br>\n");
   echo("    </tr>\n");
   echo("    <tr>\n");
   echo("      <td width=16 bgcolor=\"#000088\"></td>\n");
   echo("      <td width=8></td>\n");
   echo("      <td align=right>&nbsp;<br>From:</td>\n");
   echo("      <td>&nbsp;<br><input type=\"text\" name=\"from\" size=48 maxlength=128");
   echo("value=\"\"><br><font size = \"-1\"><i>Please <b>include</b> your email address");
   echo(" if you want a reply!</i><br></font></td>\n");
   echo("      <td width=8></td>\n");
   echo("      <td width=16 bgcolor=\"#000088\"></td>\n");
   echo("    </tr>\n");
   echo("    <tr>\n");
   echo("      <td width=16 bgcolor=\"#000088\"></td>\n");
   echo("      <td width=8></td>\n");
   echo("      <td align=right>Subject:</td>\n");
   echo("      <td><input type=\"text\" name=\"subject\" size=32 maxlength=32");
   echo("value=\"\"></td>\n");
   echo("      <td width=8></td>\n");
   echo("      <td width=16 bgcolor=\"#000088\"></td>\n");
   echo("    </tr>\n");
   echo("    <tr>\n");
   echo("      <td width=16 bgcolor=\"#000088\"></td>\n");
   echo("      <td width=8></td>\n");
   echo("      <td align=right valign=top>Message:</td>\n");
   echo("      <td><textarea name=\"message\" rows=5 cols=48></textarea><br>&nbsp;</td>\n");
   echo("      <td width=8></td>\n");
   echo("      <td width=16 bgcolor=\"#000088\"></td>\n");
   echo("    </tr>\n");
   echo("    <tr align=center>\n");
   echo("      <td colspan=6 bgcolor=\"#000088\"><input type=\"submit\" value=\"Send");
   echo(" your message\">\n");
   echo("    </tr>\n");
   echo("  </table>\n");
   echo("</form>\n");
   echo("</center>\n\n");

   // TAIL END
   echo("<hr size = 3>\n\n");
   echo("<a href=\"" . $whr . "\">" . $whd . "</a>\n\n");
   echo("<hr size = 3>\n");
   echo("<address>Script &copy; 2003 Richard Murray</address>\n");
   echo("</body>\n");
   echo("</html>\n");

   // 'ASTA LA VISTA, BABY!
   exit();
?>
