BMI display

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 1
Joined: Tue Apr 15, 2014 12:55 pm

BMI display

Postby Invokers » Tue Apr 15, 2014 1:05 pm

hello experts, i'm just a newbie that are trying to learn php for the school project, i need some help in order to do the code since i was really have almost zero knowledge about this things, i have learn c++ but php is quite different for me, if the experts here can help me, i will really happy. i will show my code...

Code: Select all

<head><title>Body BMI</title>

<body bgcolor = "#f0ffff">

<table width="600">
    <th bgcolor="silver">Pos</th>
    <th bgcolor="silver">Name</th>
    <th bgcolor="silver">Mass</th>
    <th bgcolor="silver">Height</th>
    <th bgcolor="silver">BMI</th>
    <th bgcolor="silver">1</th>




$names = array(array("rain",52,1.63),array("rain2",98,1.72),
$a = count ($names);


function bmi($mass,$height)
   $invo = $mass/pow($height,2);
   return $invo;

if ($invo < 15){
echo "<tr><td>$a</td>";
echo 'underweight';



as you guys can see, my code are mess, what im trying to do is to display the bmi of each rain in a table, with their name,mass and height, currently im stuck at this point, i dont know what to do for next, if someone help me i will be really grateful, sorry my english is really bad since im not from english speaking country. please help me. and i know there is more simplier code than this, but this is all i know, and i dont even know if this is the right way to do or not.

Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 5 guests