I am trying to set up an online registration page that will transmit the results to an email address. When I tried to do this, the email has come through without the php values and when I tried to echo some of the php to the screen, this also failed. Can anybody tell me what I am doing wrong? The code that I am using is as follows:

<?PHP

echo "<p>Thank you, <b>$POST[First]</b>, for your online registration. </p>";
echo "<p> $
POST[message] </p>";

$Title = $POST[Title];
$Other = $
POST[Other];
$Surname = $POST[Surname];
$submit = $
POST[submit];
$qc = $_POST[qc];
$date = date("F j, Y, g:i a" );

$to = "me@mydomain.com";
$subject = "Completed Online Registration";
$message = "
The following details have been submitted:
Title: $Title\n
Other: $Other\n
First: $First\n
Surname: $Surname\n
Form submitted on: $date\n
\n";

$recipient="me@mydomain.com";
$subject="Online_Form_Submission";
$mailheaders="MIME-Version:1.0\r\n";
$mailheaders="Content-Type:text/plain ; charset=ISO-8859-1\r\n";

mail($recipient,$subject,$message,$mailheaders);

?>

    i guess ur form is not being posted properly. meaning that $_POST is not getting values. check on that.

      Sorry I'm new to this. Am I meant to save my form page as a html extension or php. I've not tried it both ways and the values still aren't being displayed on either the screen or in the email. I am getting a blank email through though. The revised code is as follows:

      <html>
      <head>
      <title>Online Submission Results</title>
      </head>
      </body>

      <?PHP

      #Sending the user to new page when details submitted
      $First = $POST['First'];
      $message = $
      POST['message'];

      echo "<p>Thank you, <b>".$POST["First"]."</b>, for your online registration. </p>";
      echo "<p> ".$
      POST["message"]."</p>";

      Registering Email Variables

      $Title = $POST['Title'];
      $Other = $
      POST['Other'];
      $Surname = $POST['Surname'];
      $Email = $
      POST['Email'];
      $date = date("F j, Y, g:i a" );

      $message= "The following details have been submitted:";
      $
      message .="Title: $Title";
      $message .="Other: $Other";
      $
      message .="First: $First";
      $message .="Surname: $Surname";
      $
      message .="Email: $Email";

      #setting up the email
      $recipient="patricia@mooregroup.ie";
      $subject="Online Form Submission";
      $mailheaders="MIME-Version:1.0\r\n";
      $mailheaders.="Content-Type:text/plain ; charset=ISO-8859-1\r\n";
      $mailheaders.="From: $Email";

      #send the mail
      mail($recipient,$subject,$message,$mailheaders);

      ?>
      </body>

      Thanks

        First off... since u are not sure whether to save the form page as a html extension or php i assume that this is ur first PHP page. so... when u startoff with some thing new, u dont jump to sending emails...u start with "Hello World".

        1. ur code posted below...where does it get its details from? check if the user is entering the details and that $_POST is getting those values.

        2. why are u using the variable $_message... cudnt see it being used any where.

        if after checking point 2 u still have a prob... post the file where the user is entering data.

          Write a Reply...