3 Replies - 24820 Views - Last Post: 04 April 2008 - 11:07 AM

#1 dushi  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 40
  • Joined: 23-February 08

how do i write an if-statement in html

Post icon  Posted 04 April 2008 - 09:00 AM

<%
double Gewicht = Double.parseDouble(request.getParameter("Gewicht"));
double Lengte = Double.parseDouble(request.getParameter("Lengte"));
double BMI = Gewicht/(Lengte*Lengte);
%>


Gewicht: <%= Gewicht %><br />
Lengte: <%= Lengte %><br/>
BMI: <%= BMI %><br/>


<%if (BMI < 19)%>
You're underweigth!

<%else(BMI>==19 && BMI== <25)%>
You're OK

<%else (BMI>==25 && BMI==<32)%>
You're overweight!

<%else%>
You're obese!



<body>
</html>

Is This A Good Question/Topic? 0
  • +

Replies To: how do i write an if-statement in html

#2 Nykc  Icon User is offline

  • Gentleman of Leisure
  • member icon

Reputation: 731
  • View blog
  • Posts: 8,644
  • Joined: 14-September 07

Re: how do i write an if-statement in html

Posted 04 April 2008 - 09:02 AM

You cannot write an if statement in HTML. This looks like .asp syntax
Was This Post Helpful? 0
  • +
  • -

#3 dushi  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 40
  • Joined: 23-February 08

Re: how do i write an if-statement in html

Posted 04 April 2008 - 09:05 AM

View PostNykc, on 4 Apr, 2008 - 09:02 AM, said:

You cannot write an if statement in HTML. This looks like .asp syntax



sorry its a .jsp file
Was This Post Helpful? 0
  • +
  • -

#4 dushi  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 40
  • Joined: 23-February 08

Re: how do i write an if-statement in html

Posted 04 April 2008 - 11:07 AM

i've finished it myself
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1