Forum Moderators: coopster
-----------------------------------------------------------
<?php
########
if (!eregi("modules.php", $PHP_SELF)) {
die ("You can't access this file directly...");
}
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
include("header.php");
$index = 0;
OpenTable();
echo"<center><form method=\"POST\">"
. " <p> </p>"
. " <table cellSpacing=\"0\" cellPadding=\"0\" border=\"0\" width=\"562\">"
<modnote>removed excessive code (as per charter) for form data
. " <textarea name=\"message\" rows=\"5\" wrap=\"virtual\" cols=\"35\"></textarea></td>"
. " </tr>"
. " </table>"
. " <p><input type=\"submit\" value=\"Submit\" name=\"B1\"><input type=\"reset\" value=\"Reset\" name=\"B2\"></p>"
. " <input type=\"hidden\" name=\"reciept\" value=\"membership@site.com\">"
. " </form></center>";
CloseTable();
include("footer.php");
?>
[edited by: jatar_k at 11:45 pm (utc) on July 3, 2003]
if($_REQUEST['clan'])
{
//this guy has filled in the form
//let's send an email
$youradd = "i@love.spam";
$yourname = "Spam Monkey";
$subject = "New registration application";
$message = "The clan wanted was:".$_REQUEST['clan']." and the game-name was: ".$_REQUEST['sender_name']; //add more! one for every value in the form
$theirname = $_REQUEST['sender_name'];
$theiradd = $_REQUEST['sender_email'];
$headers =
"MIME-Version: 1.0\r\nContent-type: text/html; charset=iso-8859-1\r\nFrom: $theirname <$theiradd>\r\nTo: $yourname <$youradd>\r\nReply-To: $theirname <$theiradd>\r\nX-Priority: 1\r\nX-MSMail-Priority: High\r\n X-Mailer: VinceVinceVince's Amazing Code";
mail($youradd, $subject, $message, $headers);
}
else
{
//this guy didn't fill the form in yet
//put in the normal form output to be filled in
//ie, the echos from your current script
}
Your mail.php (or whatever you choose to call it) needs to collect the information entered and probably call the mail() function in PHP to send the message.
Look at
[php.net...]
for a description of how to do in with examples.
Keep your Nuke wrapper code so it looks nice