Can anyone tell me what I am doing wrong here? My switch will not dispaly contents of preoffession. Thanks in advance.
it is suppose to display content under select button. But it is not.
Profession:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml"[/URL] xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title> Professional Title and Contents </title>
<style type="text/css" media="screen">.error {color: red ;} </style>
</head>
<body>
<form action="selector.php" method="post">
<p>Profession:
<select name ="profession">
<option value="">Pick One</option>
<option value="engineering">Engineering</option>
<option value="botany">Botany</option>
<option value="woodcarving">Woodcarving</option>
<option value="familydoctor">Family Doctor</option>
<option value="architecture">Architecture</option>
</select></p>
<input type="submit" name="submit"
value="Select" />
</form>
<?php
switch ('profession'){
case 'engineering':
echo "Engineering is the discipline, art, skill and profession of acquiring and applying scientific, mathematical, economic, social, and practical knowledge, in order to design and build structures, machines, devices, systems, materials and processes that safely realize improvements to the lives of people.";
break;
case 'botany':
echo "Botany is a branch of biology that involves the scientific study of plant life. Botany covers a wide range of scientific disciplines including structure, growth, reproduction, metabolism, development, diseases, chemical properties, and evolutionary relationships among taxonomic groups. Botany began with early human efforts to identify edible, medicinal and poisonous plants, making it one of the oldest sciences. Today botanists study over 550,000 species of living organisms.";
break;
case 'woodcarving':
echo "Wood carving (xyloglyphy) is a form of working wood by means of a cutting tool (knife) in one hand or a chisel by two hands or with one hand on a chisel and one hand on a mallet, resulting in a wooden figure or figurine, or in the sculptural ornamentation of a wooden object. The phrase may also refer to the finished product, from individual sculptures, to hand-worked mouldings composing part of a tracery.";
break;
case 'familydoctor':
echo "Family medicine (FM) is a medical specialty devoted to comprehensive health care for people of all ages. It is a division of primary care that provides continuing and comprehensive health care for the individual and family across all ages, sexes, diseases, and parts of the body.[1] It is based on knowledge of the patient in the context of the family and the community, emphasizing disease prevention and health promotion.[2] According to the World Organization of Family Doctors (Wonca), the aim of family medicine is to provide personal, comprehensive and continuing care for the individual in the context of the family and the community";
break;
case 'architecture':
echo "Architecture (Latin architectural, from the Greek ἀρχιτέκτων – arkhitekton, from builder, carpenter, mason is both the process and product of planning, designing and construction. Architectural works, in the material form of buildings, are often perceived as cultural and political symbols and as works of art. Historical civilizations are often identified with their surviving architectural achievements. ";
break;
}//end of switch
?>
</body>
</html>
it is suppose to display content under select button. But it is not.
Profession: