Posted by Brian on 10/29/04 11:33
I wrote this script here but I cannot get the script to save to the
correct month.html. Can someone tell me what is wrong with this code?
<html>
<head>
<title>Monthly Bills</title>
</head>
<body>
<center><font size="4">Total Monthly Bills</font>
<form action="billcalculation.php" method="POST">
<br>
<select name="months">
<option value="January" name="month">January</option>
<option value="February" name="month">February</option>
<option value="March" name="month">March</option>
<option value="April" name="month">April</option>
<option value="May" name="month">May</option>
<option value="June" name="month">June</option>
<option value="July" name="month">July</option>
<option value="August" name="month">August</option>
<option value="September" name="month">September</option>
<option value="October" name="month">October</option>
<option value="November" name="month">November</option>
<option value="December" name="month">December</option>
</select><br><br>
<table border="0">
<td>Rent:</td><td><input type="text" name="apartment_rent"
size="5"></td><tr>
<td>Water & Sewage</td><td><input type="text" name="water_sewage"
size="5"></td><tr>
<td>Cell Phone:</td><td><input type="text" name="cell_phone"
size="5"></td><tr>
<td>Cable & Internet:</td><td><input type="text" name="cable_internet"
size="5"></td><tr>
<td><center><input type="submit" name="submit"
action="submit"></center></td><td><input type="reset" name="reset"
action="reset"></td></table>
</center></form>
<center><font size="4">Monthly Bills for 2005-2006</font><br><br>
<?php
$fp = fopen("$_POST['month'] . ".html","a+");
$output = print "TEST";
$apartment_rent = $_POST['apartment_rent'];
$water_sewage = $_POST['water_sewage'];
$cell_phone = $_POST['cell_phone'];
$cable_internet = $_POST['cable_internet'];
$total_monthly_bill = $apartment_rent + $water_sewage + $cell_phone +
$cable_internet;
print "Bills for <b>{$_POST['months']}</b><br>";
print "Apartment rent: $apartment_rent <br>";
print "Water and sewage: $water_sewage <br>";
print "Verizon cell phone bill: $cell_phone <br>";
print "Time Warner cable bill: $cable_internet <br>";
print "Total monthly payment: $total_monthly_bill <br>";
?>
</body>
</html>
Navigation:
[Reply to this message]
|