<input name="LastName" placeholder="Last Name" /></br> </div><br> <div> <label for="title">Title:</label> <?php $myMenu = new selectMenu(); $myMenu->setOptions($TitleArray); echo $myMenu->makeMenu("Select a Title", "Title"); ?> </div><br> <div> <label for="beatle">Beatle:</label> <?php $myMenu = new selectMenu(); $myMenu->setOptions($BeatleArray); echo $myMenu->makeMenu("Select a Beatle", "Beatle"); ?> </div><br> <input type="submit" value="Create User Name"> <input type="reset" value="reset"> </form> <style> div {margin-top: 5px; } textarea, input { border: dotted 1px blue; } </style>
private $selectMenu; // final select menu function __construct($itemArray = '') { $this->items = $itemArray; } private function buildOptions() { $this->options = "<option value=''>Select a Name</option>"; foreach ($this->items as $item) { $this->options .= "<option value='" . $item . "'>" . $item . "</option>"; } } private function buildSelect() { $this->selectMenu = "<select>" . $this->options . "</select>"; } public function setOptions($array) { $this->items = $array; } public function makeMenu() { $this->buildOptions(); $this->buildSelect(); return $this->selectMenu; } } $myMenu = new selectMenu(); $myMenu->setOptions($myArray); echo $myMenu->makeMenu();
} if (isset($_SESSION['current_location'])) { $Location = $_SESSION['current_location']; } else { $Location = new Location(); } if (isset($_SESSION['current_weather'])) { $Weather = $_SESSION['current_weather']; } else { $Weather = new weather(); } } $Soil = new soil(); $SoilList = $Soil->GetAllSoils(); $SoilMenu = new selectMenu(); $SoilMenu->setOptions($SoilList); include_once 'include/header.php'; if (isset($php_errormsg)) { ?> <h1> Please correct the following errors: <?php $php_errormsg; ?> </h1> <?php } ?> <div class="row"> <div class="col-sm-4 col-sm-offset-4"> <form action="SaveFlower.php" method="get"> <input type="hidden" name="uid" value="<?php