Web Development

How to show checkbox checked in PHP

<?php $country = array( 1 => ‘USA’, 2 => ‘UK’, 3 => ‘Japan’, 4 => ‘India’, 5 => ‘Australia’); $the_key = ‘Australia|UK|India’; // or whatever you want $myrow = explode(‘|’,$the_key); $containsSearch1 = array_intersect( $country,$myrow); foreach($country as $key=> $val) { if(in_array($val,$containsSearch1)) { echo “$val.<input type=’checkbox’ name=’check_list[]’ value=’”.$val.”‘ checked=’checked’ /><br />”; } else { echo “$val.<input type=’checkbox’… Continue reading How to show checkbox checked in PHP

Web Development

Country Code Drop Down list

HTML CODE FOR DROP DOWN Menu <select name=”county_list”> <option value=”1″>USA</option> <option value=”2″>UK</option> <option value=”3″>Japan</option> <option value=”4″ selected=”selected”>India</option> <option value=”5″>Australia</option> </select> <input value=”” name=”name” type=”text”> <input value=”go” name=”go” type=”submit”> PHP CODE FOR DROP Down Menu With Selected value <?php $the_key = 4; // or whatever you want $country = array( 1 => ‘USA’, 2 => ‘UK’,… Continue reading Country Code Drop Down list