php - Undefined Index If I Do Not Check Checkbox -


i seem have bizarre happening here. if check checkbox on form php script runs perfectly. if don't check box php reports undefined index on variable.

that's using iis localhost, checking things.

on web published identical script works no matter what. well, virtually identical. have locally added variable 'test' post-ed php , compared hard coded value. that's all.

here's html checkbox:

<tr> <td>publish comment?</td> <td><input name="publishok" value="no" type="checkbox"> check box spanstyle="font-weight: bold;">not</span> publish</td> </tr> <tr> 

and here's php variable, 'publishok' :

$ip = $_server["remote_addr"]; $publishok = $_post['publishok']; $test = $_post['test']; if ($test != 'park') die ("wrong input. sorry. go back, try again");  

i suspected editor pspad adding spurious (and invisible) char codes or upgraded latest version. no difference.

can't think cause this.

can help?

checkbox won't send data server when did not check it.

you have use isset($_post['publishok']) check whether checked in server side.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -