[PHP] Re: input type=checkbox

2008-03-14 Thread John Taylor-Johnston
http://www.glquebec.org/English/test.php When I check Knowlton and Thetford Mines or others, only Thetford Mines shows up in phpinfo(). $_POST[checkregion] only sees Thetford Mines. What am I doing wrong? How do I parse value checkregion? Or set this up differently? input type=text

[PHP] Re: input type=checkbox

2008-03-14 Thread John Taylor-Johnston
$_POST[checkregion] is supposed to be an array, no? John Taylor-Johnston wrote: http://www.glquebec.org/English/test.php When I check Knowlton and Thetford Mines or others, only Thetford Mines shows up in phpinfo(). $_POST[checkregion] only sees Thetford Mines. What am I doing wrong? How do I

Re: [PHP] Re: input type=checkbox

2008-03-14 Thread Robert Cummings
On Fri, 2008-03-14 at 23:14 -0400, John Taylor-Johnston wrote: $_POST[checkregion] is supposed to be an array, no? You want the following (otherwise each checked entry overwrites the previous): input type=checkbox name=checkregion[] value=Knowlton / input type=checkbox name=checkregion[]

Re: [PHP] Re: input type=checkbox

2008-03-14 Thread John Taylor-Johnston
Ah! ok, Array ( [0] = Hemmingford [1] = Huntingdon ) How do I set up my $sql? $sql ='insert into `database`.`table` (`Nom` ,`checkregion`) values ('John', '.implode(',', $_POST['myvalues'].') '; ... Hey!! What is this? Diagnostic-Code: smtp; 550-5.7.1 mail rejected by policy. SURBL

Re: [PHP] Re: input type=checkbox

2008-03-14 Thread John Taylor-Johnston
Will this do it? $sql ='insert into `database`.`table` (`Nom` ,`checkregion`) values ('John', '.implode(',', serialise($_POST['checkregion']).') '; http://ca.php.net/manual/en/function.serialize.php Array ( [0] = Hemmingford [1] = Huntingdon ) input type=checkbox

Re: [PHP] Re: input type=checkbox

2008-03-14 Thread John Taylor-Johnston
Sorry, will this work? $sql ='insert into `database`.`table` (`Nom` ,`checkregion`) values ('John', '.serialise($_POST['checkregion']).') '; John Taylor-Johnston wrote: Will this do it? $sql ='insert into `database`.`table` (`Nom` ,`checkregion`) values ('John', '.implode(',',

Re: [PHP] Re: input type=checkbox

2008-03-14 Thread Robert Cummings
On Sat, 2008-03-15 at 00:18 -0400, John Taylor-Johnston wrote: Sorry, will this work? $sql ='insert into `database`.`table` (`Nom` ,`checkregion`) values ('John', '.serialise($_POST['checkregion']).') '; Depends on what you want to do with the data. But you've certainly spelled serialize()

Re: [PHP] Re: input type=checkbox

2008-03-14 Thread John Taylor-Johnston
Robert, Array ( [0] = Hemmingford [1] = Huntingdon ) You want the following (otherwise each checked entry overwrites the previous): input type=checkbox name=checkregion[] value=Knowlton / input type=checkbox name=checkregion[] value=Thetford Mines / How would you proceed? $sql

Re: [PHP] Re: input type=checkbox

2008-03-14 Thread Robert Cummings
On Sat, 2008-03-15 at 00:33 -0400, John Taylor-Johnston wrote: Robert, Array ( [0] = Hemmingford [1] = Huntingdon ) You want the following (otherwise each checked entry overwrites the previous): input type=checkbox name=checkregion[] value=Knowlton / input

Re: [PHP] Re: input type=checkbox

2008-03-14 Thread John Taylor-Johnston
Robert Cummings wrote: On Sat, 2008-03-15 at 00:33 -0400, John Taylor-Johnston wrote: Robert, Array ( [0] = Hemmingford [1] = Huntingdon ) You want the following (otherwise each checked entry overwrites the previous): input type=checkbox name=checkregion[] value=Knowlton / input

Re: [PHP] Re: input type=checkbox

2008-03-14 Thread Robert Cummings
On Sat, 2008-03-15 at 01:00 -0400, John Taylor-Johnston wrote: Robert Cummings wrote: On Sat, 2008-03-15 at 00:33 -0400, John Taylor-Johnston wrote: Robert, Array ( [0] = Hemmingford [1] = Huntingdon ) You want the following (otherwise each checked entry overwrites the