ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Working with Forms in PHP, Part 1
Subject:   Php checkbox scripting
Date:   2007-03-12 11:00:48
From:   JooNix
I created an online form/application. Once submit is clicked, information on the form is direclty sent to an email consisting of all the information inputted on the online form. The following prints the info inputted into the text fields, however my problem is the script for displaying what checkbox is checked along with the text field info in the email. I have two files. One consisting of the coding for the Application and the other a PHP file consisting of the script. The following is the code I have for displaying the txt field info into the email (which works fine):
------------------------------------------------
<?php
$msg="Departmental Account Form\r\n\r\n";


$msg.="[Info. about staff that will use this departmental account]\r\n\r\n";
$msg.=" First Name: $Fname\r\n\r\n";
$msg.=" Last Name: $Lastname1\r\n\r\n";
$msg.=" Job: $Job1\r\n\r\n";
$msg.=" Email: $Email1\r\n\r\n";


$to="email@email.edu";
$subject="Departmental Account Form";
$header.="Reply-To: $Email";
$browser=getenv("HTTP_USER_AGENT");
mail($to,$subject,$msg,$header);
?>
-----------------------------------------------


What would be the checkbox script to be displayed on the email as well?