Jump to content
DevFuse Forums

najaru

Members
  • Posts

    197
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by najaru

  1. Hi Michael, hi all

     

    I've a simple php code, for take simple data , make calcule, and print the result.

     

    here my code.

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title>Calcolo</title>
    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" >
    </head>
    <body>
    <?php
    if (isset ($_POST['val_a']) && isset ($_POST['val_b']) && isset ($_POST['val_c']))
    {
    $a = (float) $_POST['val_a'];
    $b = (float) $_POST['val_b'];
    $c = (float) $_POST['val_c'];
    $risultato = @($a * $b / $c);
    if ($risultato !== FALSE)
    echo "Risultato di A*B/C = " . $risultato . "<br><br>";
    else
    echo "Errore nel calcolo<br><br>";
    }
    ?>
    <form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
    <p>
    Valore A <input id="val_a" type="text" name="val_a" size="20" maxlength="20" value="<?php echo htmlspecialchars ($_POST['val_a'], ENT_QUOTES); ?>">
    <br>
    Valore B <input id="val_b" type="text" name="val_b" size="20" maxlength="20" value="<?php echo htmlspecialchars ($_POST['val_b'], ENT_QUOTES); ?>">
    <br>
    Valore C <input id="val_c" type="text" name="val_c" size="20" maxlength="20" value="<?php echo htmlspecialchars ($_POST['val_c'], ENT_QUOTES); ?>">
    <br>
    <input type="submit" value="Calcola">
    </p>
    </form>
    </body>
    </html>

    i need to multiply the result for a SPECIFIC FACTOR, dependent by value select by user in dropdown

     

     

    $risultato = @($a * $b / $c)  * FACTOR;

     

    in dropdown for example:

     

    RED (FACTOR=1)

    GREEN (FACTOR=1,3456)

    BLUE (FACTOR=3,2965)

     

    then user can choice Red Blue or green in dropdown

     

    does is difficult?

  2. File Name: (II32) Instruction Tags

    File Submitter: najaru

    File Submitted: 21 Dec 2011

    File Category: IP.Board Modifications

     

    Description

     

    This displays an explanatory message to below the Tags box field in the new discussion form.

    Thanks to Adriano for writing hooks for Invisionita.

     

     

    Step 1: Import the Hook File

     

    Log in to your IP.Board Admin CP and visit the System tab -> Applications & Modules -> Manage Hooks page. In the 'Install a New Hook' section, browse to the XML file included with these instructions and click Open.

     

    Click here to download this file

×
×
  • Create New...