using php code within php.?

Michael Westen

New member
I probably worded it badly...but I am working on a project and i need to take the number that the user puts in and multiply it by 9.8. (to get the weight of the object)

i want to be able to reference whatever that equals later..so i think this is what i want:


<?php $fgravity = '$_POST["mass"] * 9.8';?>


<?php echo $fgravity;?>

but it doesnt work. It literally echos $_POST["mass"] * 9.8

the "mass" the user inputs on the previous page.

Does anyone know how to make this work?

Thanks!
 
Back
Top