#21696 [Opn->Fbk]: Checkbox is strange in POST event

From: Date: Thu, 16 Jan 2003 22:00:16 +0000
Subject: #21696 [Opn->Fbk]: Checkbox is strange in POST event
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-30302@lists.php.net to get a copy of this message
ID: 21696 Updated by: philip@php.net Reported By: ivanpisa@dfm.ffclrp.usp.br -Status: Open +Status: Feedback Bug Type: Unknown/Other Function Operating System: Windows XP PHP Version: 4.3.0 New Comment: Four things: a) Only checked checkboxes pass values. b) Why do you expect $a to exist at all? I see no code that creates $a. c) Have your test (form2.php) simply be: print_r($HTTP_POST_VARS); d) I believe you mean register_globals is off, there is no such thing as global_variables. e) http://www.php.net/variables.external Previous Comments: ------------------------------------------------------------------------ [2003-01-16 15:43:31] tularis@php.net ARGH! actually, ignore that comment... I'm talking bs right now :| ------------------------------------------------------------------------ [2003-01-16 15:39:54] tularis@php.net I'm not sure if it'll make any difference, but try changing this line: echo '<input type=checkbox name=married value="s">'; since ' is not supported as a valid HTML quote (that is, I THINK it isn't :S) ------------------------------------------------------------------------ [2003-01-16 15:29:28] ivanpisa@dfm.ffclrp.usp.br (continue) In fact, the error is simplier: when I run <? echo $a; ?> in machine 1, it's ok!! But in machine 2, it returns Notice: Undefined variable: a in test.php on line 2 Any clues??? Thanks ------------------------------------------------------------------------ [2003-01-16 15:26:17] ivanpisa@dfm.ffclrp.usp.br I'm using PHP 4.3.0 as ISAPI in 2 WinXP machines, running Apache 2.0.43. PHP was installed at same folders and I'm using the same PHP.INI. In machine 1, everything works great. In machine 2, everything works great too BUT when I'm using checkbox inside form posting: echo "<form method=post action=form2.php>"; echo "<br>Are married?"; echo "<input type=checkbox name=married value='s'>"; echo "</form>"; the form2.php is: <? echo "<html><body>"; $married = $HTTP_POST_VARS["married"]; echo "married = ".$married; echo "</body></html>"; ?> the response is: Notice: Undefined index: married in form2.php on line 2 In machine 1, forms with checkbox are working great, but in machine 2, it doesn't. Any ideas?? PHP.INI is the same, global_variables are OFF. Thanks in advance Ivan Pisa ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=21696&edit=1

« previous php.bugs (#30302) next »