If..else problem


#1

https://www.codecademy.com/en/courses/web-beginner-en-QF3Wb/0/3


<html>
 <head>
 </head>
 <body>
 <p>
 <?php
 $items = 4;
 if($items > 5) {
 echo "You get a 10% discount!";
 } else {
 echo "you get a 5% discount!" ;
 }
 ?>


#2

Is this your full code? If so, try adding the closing tags for paragraph, body and html.
If it isn't the full code, please post the full version and say what error you're getting.


#3

I am getting the output as the 5% discount but it tells I have make a mistake


#4

Oops, I apologise for not seeing this before, but your mistake is a simple typo. Make the 'y' on your second message capital, as it is case-sensitive.

you get a 5% discount! should be You get a 5% discount!


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.