Forums

PHP returning value instead of posting email

mikes 08 Feb, 2007
Hi, I have a PHP calculator that I wish to include, this is the code

<a name="bmi"></a><table border=1 width=200><tr><td><center><b>Metric Formula</b></center><table><tr><td valign="middle"> <form method=POST action=<?php echo $_SERVER["PHP_SELF"] ."#bmi" ?>> </td><td> Weight in Kilograms: <input size=3 name="Y" type="text"><br><br> Height in Centimeters: <input size=2 name="X" type="text"><br> <? if(floatval($_POST['X']) != 0) { echo "<br> BMI = "; echo round(($_POST['Y']) / (($_POST['X']) * ($_POST['X']))* 10000, 2); } if (!isset($_POST['X']) && !isset($_POST['Y'])) { } ?><br><center><input name="metric" value=Calculate type="submit"></center></form> </td></tr></td></tr></table></table></center>

How do I set up Chronoforms so that on pressing submit the form is refreshed with the calculation rather than returning to the index page - which is what happens if I simply place the code in the PHP form area,

many thanks

Mike
Max_admin 08 Feb, 2007
Hi,

First plz removet he form tags, then put your HTML code ONLY in the html code area, then put the PHP code which does teh computations at the ON SUBMIT area and dont put a redirect URL, it should show u the results after submit, if you want the form to show again with the results then put all the HTML code and PHP code in the on submit area, take care , always remove this form tags <form.......></form>

Cheers

Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
This topic is locked and no more replies can be posted.

© 2006 - 2024 ChronoEngine.com