I’ve got “form to mail” script that I can seem to work. I can’t seem to grab the variables after submitted. Also I want to be able to put the variable values into the message of the email being sent. That should be easy once I can get the values of the variables being passed. Any help is greatly appriciated.
[code=html]
<FORM METHOD=”POST” ACTION=”test2.php” ENCTYPE=”text/plain” NAME=”form2″>
Last Name: <INPUT TYPE=”TEXT” NAME=”last” SIZE=”15″>
First Name: <INPUT TYPE=”TEXT” NAME=”first” SIZE=”10″>
Middle Initial <INPUT TYPE=”TEXT” NAME=”mi” SIZE=”1″ MAXLENGTH=1>
Clock Number <BR><INPUT TYPE=”TEXT” NAME=”clock” SIZE=5 MAXLENGTH=5
ONKEYPRESS=”if ((event.keyCode < 48) ||
(event.keyCode > 57)) event.returnValue = false;”>
<INPUT TYPE=”hidden” NAME=”class” Value=”Systems Engineering Class #1″>
<INPUT TYPE=”hidden” NAME=”dt” Value=”January 22, 2006: 1PM – 3PM”>
<INPUT TYPE=”hidden” NAME=”place” Value=”Cleveland Conference Room”>
<INPUT TYPE=”SUBMIT” VALUE=”Submit” onClick=”return validateForm2()”>
</FORM>
[code=php]<?php
$last = $_POST[‘last’];
$first = $_POST[‘first’];
$mi = $_POST[‘mi’];
$clock = $_POST[‘clock’];
$class = $_POST[‘class’];
$dt = $_POST[‘dt’];
$place = $_POST[‘place’];
$to = ‘[email protected]’;
$subject = ‘test’;
$message =’$place’; // testing purposes
if(@mail($to, $subject, $message))
{
print ‘<p>Mail sent OK! $place</p>’;
}
else
{
print ‘<p>Error sending the mail!</p>’;
}
?>