Хорошо, я уверен, что я делаю что-то здесь не так, но я не могу заставить эти переменные PHP отображать inline!
РЕДАКТИРОВАТЬ: Это то, как код выглядит сейчас, все еще не работает.
<?php
ini_set('display_errors', true); error_reporting(E_ALL);
//declare variables
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$comments = $_POST['comments'];
$date = $_POST['date'];
$time = $_POST['time'];
$company = 'Test company';
$dateraw = $date;
$confirmText = "Thank you " . $name . " for booking your appointment with us. We look forward to seeing you at " .$time . " on " . $dateraw . ". You will receive a confirmation email shortly.";
//strip of invalid chars
$date = str_replace( '/' , '.' , $date);
//fopen
$pathToMe = dirname(__FILE__);
$fileName = $pathToMe . "/days/" . $date . ".txt";
$fileHandle = fopen($fileName, 'w') or die("Failure.");
fwrite($fileHandle, $name . "\n" . $email . "\n" . $phone . "\n" . $date . "\n" . $time . "\n" . $comments . "\n" . "\n" );
fclose($fileHandle);
//email to company
$to = 'peter@pkazz.com';
$subject = 'Apointment scheduled online';
$body = "An apointment was just scheduled online.\n" . $name . "\n" . $email . "\n" . $phone . "\n" . $date . "\n" . $time . "\n" . $comments . "\n" . "\n" . "Please follow up to confirm.";
if (mail($to, $subject, $body)) {
$companyConfirm = 'yes';
} else {
$companyConfirm = 'no';
}
//client confirm
$to = $email;
$subject = 'Confirming your appointment';
$body = "Hello " . $name . "," . "\n" . "\n" . "You recently booked an appointment with " . $company . " on " . $date . " at " . $time . ".\n" . "\n" . "We will follow up soon to confirm.";
if (mail ($to, $subject, $body)) {
$confirm = 'yes';
} else {
$confirm = 'no';
}
print_r($_POST);
?>
<html>
<head>
</head>
<body>
<div id="jqt">
<div id="home" class="current">
<div class="toolbar">
<h1>Scheduler</h1>
</div>
<ul class="edit rounded">
<li><?php echo $confirmText; ?></li>
</ul>
</div>
</div>
</div>
</body>
</html>