Results 1 to 3 of 3

Thread: Help with Math in php/html page

  1. #1
    Join Date
    Aug 2008
    Location
    Smiths, AL
    Posts
    164
    Thanks
    30
    Thanked 5 Times in 5 Posts

    Default Help with Math in php/html page

    I have a website that I am working on for one of our companies and I need to do some simple math within the page and have it return some results.

    Here is the page:
    http://www.salmipropertyholdings.com/mao.php

    What I'm trying to do is have the user input the
    House Price (HP):
    After Repair Value (ARV):
    Percent:
    and the repair costs (RC):

    then I want the page to do the math and return the results in the MAO box.

    The formula I need is: ARV x Percent - RC = MAO

    I don't know how to right the code or input it into a database if I need too so I was wondering if someone could help me or get me on the right track to find out how to do this.
    I see bank sites do things like this all the time but never really thought about how it was done until now.
    Last edited by Dirt_Diver; 01-04-2009 at 09:00 PM.

  2. #2
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    something like this then echo $value into mao as a text field area (of course all values would have to be entered correctly this doesn't test the entered information to make sure it is correct).
    PHP Code:
    <?php
    $price 
    =  $_POST['House_Price'];
    $arv $_POST['ARV'];
    $percent $_POST['percent'];
    $rc $_POST['Repair_Costs'];
    $value = ($arv $percent) - $rc;
    ?>

  3. The Following User Says Thank You to bluewalrus For This Useful Post:

    Dirt_Diver (01-04-2009)

  4. #3
    Join Date
    Apr 2008
    Location
    Limoges, France
    Posts
    395
    Thanks
    13
    Thanked 61 Times in 61 Posts

    Default

    You should post this question in the javascript forum. Javascript would be perfect for doing something like this.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •