I think I have a strange incident. If I checked the box in the form, then the PHP script works fine. If I do not check the checkbox php reports an undefined index for another variable.
This is using the local IIS host, checking things.
On the Internet, published identical work scripts work no matter what. Well, almost the same. I locally added the variable "test" POST-ed to php and compared with a hard-coded value. It's all.
Here's the html for the checkbox:
<tr> <td>Publish Comment?</td> <td><input name="publishok" value="NO" type="checkbox"> Check Box For Do spanstyle="font-weight: bold;">Not</span> Publish</td> </tr> <tr>
and here is the php for the 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 that my PSPad editor was adding false (and invisible) char codes or something else, so I upgraded to the latest version. No difference.
I canβt think what might cause this.
Can anyone help?
source share