Oooops!
Go back to isset() or emoty()
Justin
on 21/08/02 9:48 AM, David Yee ([EMAIL PROTECTED]) wrote:
> Doh- just discovered that this won't work for updates (e.g. if value is
> already = 'Y' and you uncheck the box it'll stay as 'Y').
>
> David
>
>> To throw in a curve-ball, you can set
Doh- just discovered that this won't work for updates (e.g. if value is
already = 'Y' and you uncheck the box it'll stay as 'Y').
David
> To throw in a curve-ball, you can set the default value for your MySQL
> column to 'N', which means that any value you DON'T write will be 'N', and
> those yo
On Saturday 17 August 2002 17:40, David Yee wrote:
> > It's not PHP's fault -- it's the CGI/POST specs. The browser is not
>
> sending
>
> > it through, because that's what it was told to do :)
>
> Ah- got it. That would make sense since it's the browser that's send the
> form data to the server
> It's not PHP's fault -- it's the CGI/POST specs. The browser is not
sending
> it through, because that's what it was told to do :)
>
Ah- got it. That would make sense since it's the browser that's send the
form data to the server, and if it doesn't chose to I wonder why the
CGI/POST spe
on 17/08/02 3:19 PM, David Yee ([EMAIL PROTECTED]) wrote:
> Great idea! Actually after I posted the question I thought of the same
> thing :-). This is probably the most elegant way. I am curious though why
> PHP doesn't just create the variable anyways and just assign it a null value
> if the
> I'd use an array on some way, but the other option is to see if the var is
> set, else set it to N
>
> if(isset($_POST['my_checkbox_var'])) {
> $_POST['my_checkbox_var'] = 'N';
> }
>
>
> Probably what I'd do is create an array for the possible checkbox values,
> then USE THAT ARRAY to build
I'd use an array on some way, but the other option is to see if the var is
set, else set it to N
if(isset($_POST['my_checkbox_var'])) {
$_POST['my_checkbox_var'] = 'N';
}
Probably what I'd do is create an array for the possible checkbox values,
then USE THAT ARRAY to build the form. Then I
On Fri, 2002-08-16 at 19:24, David Yee wrote:
> Hi all. For a universal form script I'm writing I want to store a 'Y' in a
> table field if a checkbox is checked and an 'N' if it's not. The problem is
> that when the form is posted if the checkbox is not checked the checkbox
> variable is not pa
8 matches
Mail list logo