AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Communication Technology

switch, forms and the Add Term page

Week 13 · Unit 3 Creating Site Pages (6), Topics 2–3: the switch statement; the Add_Term page: designing the form, GET and POST, form controls, including the header and connection pages · 3 lessons
Answers are for parents and teachers.
1
What does this print? $n = 3; switch ($n) { case 1: echo "a"; break; case 3: echo "c"; case 4: echo "d"; break; default: echo "z"; }
2
Rewrite with stacked cases so that the numbers 6 and 7 print “weekend” and 1 to 5 print “school day”.
3
Choose GET or POST and give a reason: (a) a search box for the dictionary, (b) a form that uploads a picture, (c) a form that changes a member’s level.
4
A form has <input name="title" type="text">. Write the PHP that reads what was typed (the form uses post).
5
Why must the name written in the form match the name used in PHP, letter for letter?