All I need to do is add two variables together and output the result WITHOUT having to hit a submit button. I can't figure it out....here is what I have so far
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<?php
error_reporting(0);
function setvars(){
$a = "rod";
$b = "andre";
};
$total = $a - $b;
?>
<form name="form1" id="form1" method="post" action="">
<input type="text" name='rod' value="0" />
<input type="text" name="andre" value="0" />
</form>
<?php echo $total ?>
</body>
</html>
Is this possiable? I just want you to always see the number (i.e. I put a 5 in the first field....you see the 5....I put a 3 in the second....you now see a 2)???