ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If checkbox10 is set, it'll never show a colour, regardless of the value of radiobutton1 or dropdown. I presume that's intentional. But it's clear from the results you've described that checkbox10 is always set.
Have you tried confirming the value of checkbox10? Remember that if it's set to zero or blank, it will still be set, so will still trigger the condition in your code; maybe you need to change the if() to check whether it's got a value greater than zero, rather than just checking if it's set?
It's hard to say any more than that, because I'd need to see the code where you're actually setting these variables. Without knowing what values you've got, it's not going to be easy to know why they're triggering the wrong bits of code here.
thanks for getting back to me, basialy if the checkbox10 is set than it will display that dat, if the the checkbox10 is set and than chose it to be coloured than colour it witth chosen colour.
if you quickly look at this thread and the includedlink to the pocture of the expected result you will see what am trying to achieve.
I can't see any links or pictures? Not sure what you meant there.
But anyway...
Lets say your form contains this:
<input type='checkbox' name='checkbox10' value='1' />
...and your PHP program does something like this:
$_SESSION['checkbox10'] = $_REQUEST['checkbox10'];
...and then on to the code you quoted in your question...
In that case, it's likely that $_SESSION['checkbox10'] will always be set, even if you it doesn't actually have a value, so therefore your if(isset($_SESSION['checkbox10'])) statement will always get the same result.
A better way of doing it would be to write:
if($_SESSION['checkbox10']=='1')
ie -- instead of using isset(), look for the actual value in the checkbox.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.