using explode() to fill in checkboxes


Posted on 16th Feb 2014 07:03 pm by admin

Hi

I have a field stored in a table that contains regions in the UK separated by commas. There could be any number of pieces held in this field from 1-12, based upon the users specified operating region (i.e. they could operate in multiple regions).

Did you know?Explore Trending and Topic pages for more stories like this.
I have then created a form with 12 check boxes, 1 for each possible region they could have specified. I need to automatically tick the relevant box for each region they have specified (i.e. each piece of data held in the field).

Is this doable?

I have tried experimenting with explode() but cannot figure out to this information to specific whether a check box should be ticked by default
No comments posted yet

Your Answer:

Login to answer
120 Like 25 Dislike
Previous forums Next forums
Other forums

Format String help
I have a textbox where a person enters an application number. the application number is 10 characte

Grouping and sorting results
Please help with this query.

I have 2 tables in a database, countires and cities. states look

i have no idea why this isn't working
Code: <?php
session_start();
include("connect.php");

error_reporting(E

Contact Form Not Working When I Add Validation Codes
So I built my first working PHP "Contact Us" like form. But, I have been trying to now mak

Displaying image pathname instead of image
Hello

Im trying to upload and then display images from a mysql database - Its only basic and

need help with date function
i have following form for date

Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01

Comparing Values
Hi
I'm reading data from a database and this seems to work OK.

Each system has an associat

Problem displaying "scraped" XML data
I'm basicly having trouble displaying XML data scraped from an URL using cURL.

What the code

mysql_real_escape_string
Let me preface this that I am very much a PHP noob, but I have some SQL training (not necessarily My

Vertical Alligning - Not working in 1 cell?
<?php

echo "<table id="valign" width="60%" style=

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash