[thelist] Strange checkbox issue (PHP / Forms)

Hugh Miller hmiller at cfpress.co.uk
Wed Mar 4 08:27:33 CST 2009


I'm pretty convinced that the error is elsewhere in the script, 
somewhere that is interfering with $_POST as Jack says.

To post the script is far beyond what anyone on the list would be 
willing to put up with, I'm just going to have to go with temporary on / 
off radio buttons and debug the whole thing. I will post what I find 
here as it might be useful to someone in the future. But to post the 
entire script would be in excess of 10,000 lines of PHP code.

I was rather hoping it was something stupid that I'd done that one of 
you eagle eyed guys would have been able to slap me around the head with.

Cheers for taking the time to look folks.

H

Jack Timmons wrote:
> On Wed, Mar 4, 2009 at 7:06 AM, ben morrison <morrison.ben at gmail.com> wrote:
>
>   
>> On Wed, Mar 4, 2009 at 11:06 AM, Hugh Miller <hmiller at cfpress.co.uk>
>> wrote:
>> Try adding true, so it prints out the contents:
>>
>> print_r($_POST['subsection'], true);
>>
>>     
>
> Adding "true" only makes print_r return the output, not display it. If you
> use "true", you would want to do it as so:
>
> $string - print_r($_POST,true);
>
>
>   
>> isset() just tests to see if it 'is set' - which it is, the way you have
>> coded it.
>>
>> Maybe it would be better to test for empty:
>>
>> if (false == empty($_POST['subsection'])) {
>>    //do something
>> }
>>
>>     
>
> !empty($_POST) would work just as well, to save some space.
>
> And I'm assuming the problem is that he's checking boxes but nothing is
> showing up there, which leads back to my original request of either
> pastebin[1] code or to be able to take a look at it.
>
> I'm thinking your script is overwriting the POST variable elsewhere.
>
> 1 - http://pastebin.com/
>
>   



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




More information about the thelist mailing list