Right Guys,
I have this code and for some reason its not working. Can any of you spot any mistakes or somthing missing?
<h3 align="center" class="style1"> Instructions </h3>
<div align="center"><span class="style1">
<div align="center" class="style1">Please fill in the cost per month with the price not including VAT.<br>
The Date of Renewal must be as such - 01 01 2000
<table width="400px" style="border" bgcolor="#808080">
</span>
</div>
</div>
<tr>
<td>
<P align="center">
<form method='post'>
<div align="center">
<div align="center"><span class="style1">Cost per month </span>
<input type=text name=cpm>
<br>
<span class="style1">Date of Renewal: Day</span>
<input type=text maxlength=2 size=2 name=rday>
<span class="style1">Month</span>
<input type=text maxlength=2 size=2 name=rmonth>
<span class="style1">Year</span>
<input type=text maxlength=4 size=2 name=ryear>
<br>
<input type=submit name='calculate' value='Calculate'>
<input type=reset name='reset' value='Reset'>
<?php
if (isset($_POST["calculate"]) && $cpm='')
echo "Please enter a number into the Cost per month box";
$todaysdate = time();
if (isset($_POST["calculate"]) && $rday=''){
echo "Please enter a numberinto the Renewal Day Date.";}
if (isset($_POST["calculate"]) && $rmonth=''){
echo "Please enter a numberinto the Renewal Month Date.";}
if (isset($_POST["calculate"]) && $ryear=''){
echo "Please enter a numberinto the Renewal Year Date.";}
$costpermonth = $_GET[cpm];
$renewalday = $_GET[rday];
$renewalmonth = $_GET[rmonth];
$renewalyear = $_GET[ryear];
$renewalseconds = mktime(0, 0, 0, $renewalmonth, $renewalday, $renewalyear, 0);
$timedifference = $renewalseconds - $todaysdate;
$VAT = (int)($costpermonth/100)*17.5;
$price = $costpermonth / $timedifference;
$totalprice = $price + $VAT;
//Output final calculations
echo"<br>";
echo"<br>";
echo"<br>";
print_r('$VAT, $price, $totalprice');
if (isset($_POST["calculate"])) {echo "The total price is $totalprice";}
echo"<br>";
if (isset($_POST["calculate"])) {echo "The price without VAT is $price";}
echo"<br>";
if (isset($_POST["calculate"])) {echo "The VAT is $VAT";}
echo"<br>";
?>
</div>
Im not sure if ive used time and mktime wrong. Please help!