July 13, 201511 yr 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> Edited July 16, 201511 yr by rallport Please use code tags in the future
July 18, 201511 yr I do not understand the question? You already have those fields in the body from this line ... $ebody=$eltype . " " . $elstart . " " . $elend; So what is it you wanting to do? Send it an email? Have you looked at PHPs mail() function?
Create an account or sign in to comment