Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Set up a form to submit to itself Use an if - else structure Use a switch structure Preparing to do work Fork and clone.
Set up a form to submit to itself
Use an ifelse structure
Use a switch structure
Preparing to do work
Fork and clone. Follow the steps outlined in Assignment except use the launchers on this assignment
Note: you don't need to generate your ssh keys and assign them again. You only had to do that once which you did on Assignment
Description
We'll be a building an app to find out more details of Pac universities
We'll be building a form that accepts a name of a university in two versions and then returning the mascot and enrollment for searched university.
Two possibilities of each university is acceptable as the name. Here's a list of acceptable names:
Utah or UT
Arizona or AZ
Arizona State or ASU
California or UC
UCLA or University of California LA
Colorado or University of Colorado
Oregon or UO
Oregon State or OSU
USC or Southern California
Stanford or Stanford University
Washington or UW
Washington State or WSU
Thus, if someone enters Utah or UT then a mascot of Utes and the enrollment of is returned.
Use this image for reference to the enrollment and mascots
Screenshot at AMpng
Specifications
Open the terminal window
Change directory using the cd command to the directory that you cloned for the assignment.
Enter git checkout b assignmentselection at the command line prompt to create an assignment branch
Create a file called selection.php
Use an HTML template with a PHP block in the body tags and title of Selection
Assure $name, $mascot, and $enrollment are declared with initial empty values
Setup a form that submits to itself using POST
The form will have a name field and a submit button
After form is submitted use ifelse structure to determine and assign $mascot
Use a switch statement on the $mascot to then determine and assign the $enrollment
In the PHP block that resides in the body tags, if $name has a value output: School is: where name is bold
In the PHP block that resides in the body tags, if $mascot has a value output: Mascot is and it is bold
In the PHP block that resides in the body tags, if $enrollment has a value output: Enrollment is: in bold
If no name is recognized then output a message saying: School not found
If no name is entered then output a message saying: No name entered
Below is a demonstration of desired outcome no audio:
Hint:
If you follow this pattern then it should get you pretty far. Basically, initialize your variables but don't assign them until you know the form has been submitted re: $POST
$name ;
$mascot ;
$enrollment ;
$submitted false;
if isset$POSTsubmit
Assignment Submission
Enter git add all at the command line prompt to add the files or changes to the repository
Enter git status to see the changes to be committed
Enter git commit m 'Selection Assignment complete' at the command line to commit new fileschanges
Enter git push origin assignmentselection to push the changes to Gitlab
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started