information

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
Daniyal
Forum Newbie
Posts: 14
Joined: Tue Jul 19, 2016 4:08 am

information

Post by Daniyal »

Code: Select all

<html>
  <head>
  <title> conditions </title>
  </head>
  <body>
      <?php
      $items = 10;

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

Tell me the error in this code ??????? plz tell me
this msg is shown (Oops, try again. It looks like you didn't print anything! ) why ?????
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: information

Post by Celauran »

There's nothing wrong with that code. What is this error message and where is it coming from?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: information

Post by requinix »

Are you doing the Codeacademy thing? Did you see the part about making the code output the 5% discount?
Daniyal
Forum Newbie
Posts: 14
Joined: Tue Jul 19, 2016 4:08 am

Re: information

Post by Daniyal »

yes
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: information

Post by Christopher »

Daniyal wrote:yes
requinix asked two questions. Is that an answer to the first question or both?
(#10850)
Daniyal
Forum Newbie
Posts: 14
Joined: Tue Jul 19, 2016 4:08 am

Re: information

Post by Daniyal »

first i am doing the codeacademy course :)
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: information

Post by requinix »

So you did not see the part about making the code output the 5% discount? 10 is greater than 5 so your code will output the 10% discount. And the error message mean not you didn't output anything but that you didn't output the correct response.

Take a look at the original code they presented. $items did not have a value of 10. The previous course did have you change the value, but that was a different thing.
Daniyal
Forum Newbie
Posts: 14
Joined: Tue Jul 19, 2016 4:08 am

Re: information

Post by Daniyal »

ok i have done it :)
thnx
Daniyal
Forum Newbie
Posts: 14
Joined: Tue Jul 19, 2016 4:08 am

Re: information

Post by Daniyal »

one more thing
anyone plz go to this link and tell me the write code plz using instructions ????

https://www.codecademy.com/courses/web- ... dd89003eb8#
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: information

Post by requinix »

If you tell you the answer then you won't be learning, will you?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: information

Post by Christopher »

For 01 they show you the answer in the example. You should be able to do 02. Show us your idea for 03.
(#10850)
Post Reply