Hi everyone I found this script to display a BMI form on my webpage and it works great but when you click on submit it goes back to index.php. is there anyway to make it so it stays on the same page?? The script is below:
"; echo "Weigth, kg: ".$weightkg."
"; echo "Body Mass Index (BMI): ".$bmi."
"; echo ""; if ($bmi<16.5) {echo "Severely Underweight
";} if ($bmi>=16.5 && $bmi<=18.4) {echo "Underweight
";} if ($bmi>=18.5 && $bmi<=24.9) {echo "Normal
";} if ($bmi>=25 && $bmi<=29.9) {echo "Overweight
";} if ($bmi>=30 && $bmi<=34.9) {echo "Obese Class I
";} if ($bmi>=35 && $bmi<=39.9) {echo "Obese Class II
";} if ($bmi>=40) {echo "Obese Class III
";} echo "
"; } $domain = $_SERVER['HTTP_HOST']; $path = $_SERVER['SCRIPT_NAME']; $queryString = $_SERVER['QUERY_STRING']; $url = "http://" . $domain . $path; $url3 = "http://" . $domain . $_SERVER['REQUEST_URI']; $mystring1="?"; $s1=strpos($url3,$mystring1); if($s1==0) {$url2=$url3;} if($s1!=0) {$url2=substr($url3,0,$s1);} $path = $url2; //1 foot = 0.3048 meters //1 inch = 2.54 centimeters //1 pound = 0.45359237 kilograms $n1=230; echo "
";
//echo "BMI Calculator"; echo ""; echo "Height"; echo ""; for ($i=30; $i<=$n1; $i++){ echo "".$i." cm / ".floor($i / 30.48)." ft ".round(($i-(floor($i / 30.48)*30.48)) / 2.54, 1)." in ";} echo ""; echo " "; echo "Weight "; echo ""; for ($i=30; $i<=$n1; $i++){ echo "".$i." kg / ".round($i / 0.45359237,2)." pounds ";} echo ""; echo " "; //echo ""; echo " "; echo ""; echo " "; //DON'T REMOVE THIS LINK - DO NOT VIOLATE GNU/GPL LICENSE!!! echo "Nutrition Calorie Counter"; //DON'T REMOVE THIS LINK - DO NOT VIOLATE GNU/GPL LICENSE!!! echo " |