I'm trying to make a calculator that will take inputs from users and estimate for them how much money they'll save if they use various different VoIP services.
I've set it up like this:
<form method="get" action="voip_calculator.php">
How much is your monthly phone bill?
<input name="monthlybill" type="text" value="$" size="8">
<p><input type="submit" name="Submit" value="Submit">
</p>
</form>
On voipcalculator.php, the page I point to, I want to call "monthlybill" but I can't figure out how to do it. I also can't figure out how to make it do the subtraction on the numbers in the rows.
This may be very simple to you but it's very frustrating to me and I am humbly asking for a bit of help. Thank you!
Here is the relevant stuff from voip_calculator, you can also click on the url and submit a number to see it in (in)action. I tried various times to call it with no success:
<table width="100%;" border="0" cellspacing="0" cellpadding="0"class="credit_table2" >
<tr class="credit_table2_brd">
<td class="credit_table2_brd_lbl" width="100px;">Services:</td>
<td class="credit_table2_brd_lbl" width="120px;">Our Ratings:</td>
<td class="credit_table2_brd_lbl" width="155px;">Your Annual Savings:</td>
</tr>
Your monthly bill was <?php echo 'monthlybill' ?>
<?php echo "$monthlybill"; ?>
<?php echo "monthlybill"; ?>
<?php echo '$monthlybill'; ?>
<?php echo 'monthlybill'; ?>
<?php
$monthybill="monthlybill";
$re=1;
$offer ='offer'.$re.'name';
$offername= ${$offer};
while($offername!="") {
$offerlo ='offer'.$re.'logo';
$offerlogo=${$offerlo};
$offerli ='offer'.$re.'link';
$offerlink=${$offerli};
$offeran ='offer'.$re.'anchor';
$offeranchor=${$offeran};
$offerst ='offer'.$re.'star1';
$offerstar=${$offerst};
$offerbot='offer'.$re.'bottomline';
$offerbottomline=${$offerbot};
$offerca ='offer'.$re.'calcsavings';
$offercalcsavings=${$offerca};
echo '<tr >
<td >
<a href="'.$offerlink.'" target="blank">
<img src="http://www.nextadvisor.com'.$offerlogo.'" alt="'.$offername.'" />
</a>
</td>
<td >
<span class="rating_text">Rating:</span>
<span class="star_rating1">
<img src="IMAGE'.$offerstar.'" alt="" />
</span>
<br />
<div style="margin-top:5px; color:#0000FF;">
<a href="'.$offerlink.'" target="blank">Go to Site</a>
<span style="margin:0px 7px 0px 7px;">|</span>
<a href="'.$offeranchor.'">Review</a>
</div>
</td>
<td >'.$offercalcsavings.'</td>
</tr>';
$re=$re+1;
$offer ='offer'.$re.'name';
$offername= ${$offer};
}
?>
offercal(1,2,3,4,5,6,7)savings calls to a file called values.php where they are defined like this:
$offer1calcsavings="24.99";
$offer2calcsavings="20.00";
$offer3calcsavings="21.95";
$offer4calcsavings="23.95";
$offer5calcsavings="19.95";
$offer6calcsavings="23.97";
$offer7calcsavings="24.99";