its me again, still on that calculator script, thanks for your help thus far!
I want to make it so that the calculator does not need to reload the page every time a problem is put in. I don’t know if this can be done with php alone, but I just thought that maybe if i set the form to call to a javascript function, in which i stuck the php code, this just might work. The problem then becomes posting the final output to the correct place on the page, and getting the notation for the javascript function down.
[code=php]
<?php
if(isset($_POST[‘calc’])){
$hist = $_POST[‘hist’];
$calc = $_POST[‘calc’];
eval(“$result=” . $calc . “;”);
$hist = $hist . $calc. ” = ” . $result . “<br>”;
echo $hist ;
}
?>
<form method=”post” action=”<?php echo $_SERVER[‘PHP_SELF’] ?>”>
<input type=”hidden” name=”hist” value=”<?php echo($hist); ?>”>
<input type=”text” name=”calc” size=”50″><br>
<input type=”submit” value=”solve”>
</form>
that’s the current source. If there is a better way to do this (not what i already have, but what i am trying to accomplish), using only php, please tell me if not, any ideas on how I can make this work?