<?php
session_start();
$header="MIME-Version: 1.0".PHP_EOL;
$header.="From:Hertz-UTS@uts.edu.au".PHP_EOL;
$header.="Content-Type:text/html;charset=utf-8".PHP_EOL;
$address=$_POST['email'];
$subject='Thanks for shoping';
$message="<html>".$_POST['lname']." ".$_POST['fname'].":<br/> Thanks for renting cars from Hertz-Uts,the
costs is"." ".$_POST['cost'].".</br>Details are as follows:<br/>";
//echo $message;
$carArray = simplexml_load_file("carr.xml") or die("failed");
foreach($_SESSION['car'] as $key=>$i) {
foreach($carArray->children() as $c){
if ($c->Model == $i){
$year = $c->ModelYear;
$m=$c->Mileage;
$type=$c->FuelType;
$seats=$c->Seats;
$des=$c->Description;
$price = $c->PricePerDay;
$brand = $c->Brand;
$model=$c->Model;
}
$title = $year."-".$brand."-".$i;
$img="pic/".$model.'.jpg';
}
$tian=$_SESSION['day'][$key];
$message= $message."model:$title</br>mileage:$m kms</br>fuel_type:$type</br>seats:$seats<br/>price_per_day:$price<br>
rent_days:$tian<br/>description:$des<br></html>";
}
$txt = wordwrap($message,70);
echo $txt;
mail($address,$subject,$txt,$header);
?>