Passing Variables and Internal Variables

From: Date: Wed, 29 Jan 2003 23:41:14 +0000
Subject: Passing Variables and Internal Variables
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-18194@lists.php.net to get a copy of this message
01292003 1540 CST When I run this script I get the html at the end but no $result. If the result is run on the same page as the output, there shouldnt be anything variable wise stopping this from running, right? Wade <?php
    if (($_POST["val1"] == " ") || ($_POST["val2"] == " ") ||
($_POST["calc"] == " "))
    {
        header("Location: http://localhost/Learning PHP/PHP Fast &
Easy/Ch_6/calculate_form.html");
        exit;
    }
    if ($_POST["calc"] == "add")
    {
        $result = $val1 + $val2;
    }
        else if ($_POST["calc"] == "subtract")
        {
             $result = $val1 - $val2;
        }
        else if ($_POST["calc"] == "multiply")
        {
             $result = $val1 *  $val2;
        }
        else if ($_POST["calc"] == "divide")
        {
            $result = $val1 / $val2;
        }
?> <html> <head> <title>Calculation Result</title> <head> <body>
    <p>The result of the calculation is: <?php "$result"; ?></p>
</body> </html>

« previous php.windows (#18194) next »