Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php select option

// Page containing a form:
<form action="myaction.php" method="post">
 <select name="fruit">
    <option value="Apple">Apple</option>
    <option value="Banana">Banana</option>
 </select>  
 <input type="submit" value="Submit">
</form>

// myaction.php
Hello <?php echo htmlspecialchars($_POST['fruit']); ?>
Comment

php select option selected from database

<?php

$selection = array('PHP', 'ASP');
echo '<select>
      <option value="0">Please Select Option</option>';

foreach ($selection as $selection) {
    $selected = ($options == $selection) ? "selected" : "";
    echo '<option '.$selected.' value="'.$selection.'">'.$selection.'</option>';
}

echo '</select>';
Comment

PREVIOUS NEXT
Code Example
Php :: yii2 gridview filter exact value 
Php :: php if negative make positive 
Php :: laravel eloquent mass update 
Php :: curl get response headers php 
Php :: running a php project 
Php :: phpspreadsheet set cell by column and row 
Php :: destrroy a session php 
Php :: php get post json data 
Php :: array constant in php 
Php :: WooCommerce cart API php 
Php :: php www to non www redirect 
Php :: laravel server sent events 
Php :: how to insert multiple selected checkbox values in database in php 
Php :: how to get event dates on change in datetimepicker with laravel livewire 
Php :: get request data in observer laravel 
Php :: export PATH=/Applications/MAMP/bin/php/php5.4.10/bin:$PATH 
Php :: my vscode extension prettier doesnot work for php code 
Php :: laravel required_if 
Php :: laravel validation digits 
Php :: create database from migration laravel for all 
Php :: insert date of birth on the database using php 
Php :: nginx 404 not found laravel 
Php :: Increase the PHP memory limit 
Php :: wordpress log errors 
Php :: do i need to install php after xampp 
Php :: php extract month and year from date 
Php :: pg_dump with user name password 
Php :: yii2 jquery head 
Php :: laravel set appends 
Php :: form validation for file type in codeigniter 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =