php if statement help

Associate
Joined
27 Feb 2006
Posts
1,750
Location
Normanton
I have a tick box on a form and when you tick it, it returns a value of on and when its not ticked it returns no value

the tick box id is fixed
what i wanting to do is do a something like this
If $fixed = 'on' set $fixed to '1' or if $fixed = '' then set $fixed = '0'

Just dont know how to do this in php

Cheers
 
Not really sure if I understand what you mean but this might work, or you can probably work it out and change it if not:

Code:
if ($fixed == 'on') {
    $fixed = '1';
} else {
    $fixed = '0';
}
 
Back
Top Bottom