Hi all,
I would really appreciate some help here:
I have the following script with which I intend to:
email the details of the data entered in 3 fields on the webpage (html part).
The fields are:
Leave Type (options)
Start Date (text)
End Date (text)
I'm already picking up the Staff number from a XML file using pHp which works great.
Now I just need to also include in this email the Leave Type, Start Date and End Date as part of the email Body
<?php
session_start();
if(!file_exists('users/'.$_SESSION['username'].'.xml')){
header('Location: login.php');
die;
}
$hre = new SimpleXMLElement('users/hremail.xml', 0, true);
$epos=$hre->email;
$eltype=$_POST['Leave_Type'];
$elstart=$_POST['Start_Date'];
$elend=$_POST['End_Date'];
$ebody=$eltype . " " . $elstart . " " . $elend;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>User Page</title>
</head>
<body>
<form method="post">
<center>
Leave Type <select name=Leave_Type>
<option value="Annual">Annual</option>
<option value="Sick">Sick</option>
<option value="Family">Family</option>
</select></br></br>
Start Date <input type="text" name=Start_Date></br></br>
End Date <input type="text" name=End_Date></br></br>
<a href="mailto:<?php echo $epos ?>?subject=Application for Leave for <?php echo $_SESSION['username']?>&body=<?php echo $ebody ?>" >Apply</a>
</center>
</FORM>
</body>
</html>