Hi All (this may have been posted in the wrong area previously)
I am fairly new to PHP and self taught, which will be evident from my code.
I have attached a TXT file with the php. (also pasted a snippet of code below) , which I have been trying for nearly a week to get a variable displayed on the screen.
the variable is $var_price. The function appears to work (Calculate Price) but the $var_price will not display. Any ideas appriciated
Thanks
Steve
---SNIPPET OF HTML
<div id="Html2" style="position:absolute;left:387px;top:533px;width:100px;height:54px;z-index:38">
<?php echo $var_price; ?></div>
-------PHP SCRIPT
<?php
function CalculatePrice()
{
$var_price = $POST['field_width'] * $POST['field_height'];
}
// session_start();
$var_script = $_SERVER["SCRIPT_NAME"];
// ini_set('display_errors', 1);
// error_reporting(E_ALL);
$action = isset($_POST['action']) ? $_POST['action'] : '';
$value = strtoupper(substr($action, 0, 3));
switch ($value)
{
// Calculate Price
case "GET":
CalculatePrice();
break;
// recalculate
case "BAC":
header("Location: "."index.html");
break;
}
?>