CMPS 002 - Computer Literacy

Prof. Paulo Franca

CyberSlug Rules!

Classes

Class Syllabus

Grading Policy

Labs

Interact

Login

  • enter system
  • get attendance
  • submit work
  • take lab quiz
  • check scores

Help

Help me!

Links

Staff only

 

 

 

Datacare   Ahshay

 

<?
// Sample program to illustrate the use of forms
// this program takes two inputs passed by the form:
// mascot - the answer to "What is the official mascot ..."
// yourname - name of user
// The program verifies if the answer is correct and takes appropriate action
//
// Start of program
// the correct answer to the mascot is "slug"
// Before comparing the mascot value, we trim and convert to uppercase

if(trim(strtoupper($mascot))=="SLUG")
{
    // this is the correct answer
echo 'Great, '.$yourname.' you got it right!';
    echo '<br><a href="forms.htm">Continue</a>';
}
else
{
    // this is the wrong answer
    echo 'OOPS! '.$yourname.' You need to learn more about your school.';
    echo '<br><a href="forms.htm">Continue</a>';

}
?>