WordPress.org

Ready to get started?Download WordPress

Forums

How to add PHP Calculation to Page (3 posts)

  1. echenard
    Member
    Posted 3 years ago #

    I am trying to add a page to my wordpress site that allows users to add in price and shipping options and then calculate the total cost. It works fine on the server outside of wordpress but when I add it to wordpress, I get a 404 error. What am I missing here? I've added PHP Execution but still it doesn't work. Here is the code I'm using

    <!-- Script 4.1 - calculator.html -->
    <div><p>Fill out this form to calculate the total cost:</p>

    <form action="handle_calc.php" method="post">

    <p>Price: <input type="text" name="price" size="5" /></p>

    <p>Quantity: <input type="text" name="quantity" size="5" /></p>

    <p>Discount: <input type="text" name="discount" size="5" /></p>

    <p>Tax: <input type="text" name="tax" size="3" /> (%)</p>

    <p>Shipping method: <select name="shipping">
    <option value="5.00">Slow and steady</option>
    <option value="8.95">Put a move on it.</option>
    <option value="19.36">I need it yesterday!</option>
    </select></p>

    <p>Number of payments to make: <input type="text" name="payments" size="3" /></p>

    <input type="submit" name="submit" value="Calculate!" />

    </form>

    </div>

  2. djhocking
    Member
    Posted 3 years ago #

    I too am looking for this same information. I am contemplating using a plugin like exec-PHP but would rather avoid using a plugin unless it's really the best way (for people of my limited expertise).

  3. TriLeafDesigns
    Member
    Posted 3 years ago #

    I'm also looking for something very similiar, did you guys end up finding anything out?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags