9:00 に出席した場合、8:30 時間 (これは勤務時間) + 00:30 (これは休憩時間) が追加されると仮定する簡単なスクリプトがあります。そして、出発時刻が(6:00)になるように出力されますが、理由がわからずに機能しません:
<form id="form1" id="form1" action="mail.php" method="POST">
<label>time
<span class="small">Add your attendance time</span>
</label>
<input type="text" name="time" value="9:00" >
<label>Email
<span class="small">Enter a Valid Email</span>
</label>
<input type="text" name="email" value="amd@dt4it.com">
<br />
<br />
<label>break
<span class="small">break </span>
</label>
<select name="break" size="1">
<option value="00:30">yes</option>
<option value="00:00">no</option>
</select>
<br />
<br />
<br />
<button type="submit" value="Send" style="margin-top:15px;">Submit</button>
<div class="spacer"></div>
</form>
<?php
$time = $_POST['time'] + $_POST['break'] ;
$email = $_POST['email'];
$formcontent=" From: $time ";
$recipient = $email;
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You!" . " -" . "<a href='form.html' style='text-decoration:none;color:#ff0099;'> Return Home</a>";
$time2 = strtotime($time)+ strtotime("08:30");
$result = date("H:i",strtotime($time2));
echo $result;
?>