PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Thu Sep 24, 2020 1:58 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: information
PostPosted: Wed Jul 20, 2016 12:37 pm 
Offline
Forum Newbie

Joined: Tue Jul 19, 2016 4:08 am
Posts: 14
Syntax: [ Download ] [ Hide ]
<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 ?????


Top
 Profile  
 
 Post subject: Re: information
PostPosted: Wed Jul 20, 2016 12:51 pm 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6425
Location: Montreal, Canada
There's nothing wrong with that code. What is this error message and where is it coming from?

_________________


Top
 Profile  
 
 Post subject: Re: information
PostPosted: Wed Jul 20, 2016 1:30 pm 
Offline
Spammer :|
User avatar

Joined: Wed Oct 15, 2008 2:35 am
Posts: 6617
Location: WA, USA
Are you doing the Codeacademy thing? Did you see the part about making the code output the 5% discount?


Top
 Profile  
 
 Post subject: Re: information
PostPosted: Thu Jul 28, 2016 5:14 am 
Offline
Forum Newbie

Joined: Tue Jul 19, 2016 4:08 am
Posts: 14
yes


Top
 Profile  
 
 Post subject: Re: information
PostPosted: Thu Jul 28, 2016 11:59 am 
Offline
Site Administrator
User avatar

Joined: Wed Aug 25, 2004 7:54 pm
Posts: 13592
Location: New York, NY, US

_________________
(#10850)


Top
 Profile  
 
 Post subject: Re: information
PostPosted: Thu Jul 28, 2016 1:37 pm 
Offline
Forum Newbie

Joined: Tue Jul 19, 2016 4:08 am
Posts: 14
first i am doing the codeacademy course :)


Top
 Profile  
 
 Post subject: Re: information
PostPosted: Thu Jul 28, 2016 2:36 pm 
Offline
Spammer :|
User avatar

Joined: Wed Oct 15, 2008 2:35 am
Posts: 6617
Location: WA, USA
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.


Top
 Profile  
 
 Post subject: Re: information
PostPosted: Thu Jul 28, 2016 2:47 pm 
Offline
Forum Newbie

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


Top
 Profile  
 
 Post subject: Re: information
PostPosted: Thu Jul 28, 2016 2:49 pm 
Offline
Forum Newbie

Joined: Tue Jul 19, 2016 4:08 am
Posts: 14
one more thing
anyone plz go to this link and tell me the write code plz using instructions ????

https://www.codecademy.com/courses/web- ... d89003eb8#


Top
 Profile  
 
 Post subject: Re: information
PostPosted: Thu Jul 28, 2016 3:01 pm 
Offline
Spammer :|
User avatar

Joined: Wed Oct 15, 2008 2:35 am
Posts: 6617
Location: WA, USA
If you tell you the answer then you won't be learning, will you?


Top
 Profile  
 
 Post subject: Re: information
PostPosted: Thu Jul 28, 2016 6:44 pm 
Offline
Site Administrator
User avatar

Joined: Wed Aug 25, 2004 7:54 pm
Posts: 13592
Location: New York, NY, US
For 01 they show you the answer in the example. You should be able to do 02. Show us your idea for 03.

_________________
(#10850)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group