Jump to content

Explenation on displaying results ..Learner


RHOD

Recommended Posts

Ok so i am just starting out and i am learning from a PHP book that i have.

My question is when i write a statement like the one below, which may have mistakes what ever its just an example.. I understand the coding and what it is doing etc

but the book never explains how to use that code

where do i state the students score so that the code will use it and it will display the information in the echo statement below, im just getting annoyed at learning the code but not know or being able to put it into use and as i am a learner i don't really know until the book tells me

Any help pleassse???

Thanks  ??? ???

 

 

<?PHP

if ( condition )

{

$grade = "A";

$message = "Excellent";

}

elseif ($score <= 92 and $score > 83 )

{

$grade = "B";

$message = "Good work";

}

elseif ($score <= 83 and $score > 74 )

{

$grade = "C";

$message = "OK"

}

elseif ($score <= 74 and $score > 62)

{

$grade = "D";

$message = "You suck";

}

else

{

$grade = "F";

$message = "Doom On You!"

}

echo $message. "\n";

echo "Your grade is $grade\n";

?>

Hi thanks for the info that did help in this case didnt explain why or how  :P but thats ok

I do have a couple of more queries, Does my wamp server always have to be running in order to preview the php on my computer?

and how or could i create a simple form so say the teacher can enter the students score on a html based page and have the php then display the result rather then having to enter the it into the php coding itself? is it a simple thing to do  ???

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.