
Originally Posted by
bdweb
Thanks and i finaly make it
But When I create a check box in a forum if the user did not select the check box and click submit it shows me,
Notice: Undefined index: php in c:\program files\easyphp1-8\www\webhosting\view.php on line 9
I use this funtion to call the variable from a forum
$php = $HTTP_POST_VARS['php'];
view.php
Which command or fution shall I use for check box
Can any one help me about this
Thanks in adv
Checkbox's took me a while to get used to using, and get "proficient" at using them. Is what you are doing is trying to make it so you can tell if a checkbox was checked or not? I think that's what you mean. Anyways, if you have to make a checkbox:
Code:
<input type="checkbox" name="php" value="1">
You can then check if it was checked when the form was submitted by doing:
Code:
if ($_POST['php'] == 1) {
$checked = 1;
} else {
$checked = 0;
}
if ($checked == 0) {
// Do whatever, the checkbox was not checked.
} else {
// The checkbox was checked.
}
That right there is the method that I use to check if a checkbox is checked. I'm still not sure if that's what you meant, or needed. Also, you should use the "$_POST" global array instead of "$HTTP_POST_VARS". If you need anymore help, if this even was help, PM me, or just post in here...