Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

BMI display

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

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
<html>
<head><title>Body BMI</title>
</head>
<body>
<h2>BODY MASS INDEX</h>

<body bgcolor = "#f0ffff">

<table width="600">
  <tr>
    <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>
  </tr>
  <tr>
    <th bgcolor="silver">1</th>

  </tr>
 
</table>
</body>

<?php

//...................Invoke............

$names = array(array("rain",52,1.63),array("rain2",98,1.72),
array("rain3",75,1.42),array("rain4",82,1.68),array("rain5",111,1.47));
$a = count ($names);

//...................Invokecalc....

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

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

?>

</body>
</html>



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.
Invokers
New php-forum User
New php-forum User
 
Posts: 1
Joined: Tue Apr 15, 2014 12:55 pm

Return to PHP coding => General

Who is online

Users browsing this forum: Google Feedfetcher and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron