3. Adding an Else


#1


https://www.codecademy.com/courses/web-beginner-en-QF3Wb/0/3?curriculum_id=5124ef4c78d510dd89003eb8


All it says is:
Parse error: syntax error, unexpected $end, expecting T_VARIABLE or T_DOLLAR_OPEN_CURLY_BRACES or T_CURLY_OPEN on line 19
I've seen other topics and none of them helped.

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


#2

Hi sw0rddance,

Your code is working fine...and there's no line 19 here ....are you still getting the error??


#3

Yep. It's really stupid...:rage:


#4

Could you provide a screenshot of your code window along with the error?


#5


#6

It's working here at my end.....try refreshing the browser and try again


#7

Well, I've been working on this one for days...so of course I've already refreshed it.


#8

Fixed it. Thanks for your help anyway, @abhi.borkakoty


#9

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