NYCPHP Meetup

NYPHP.org

[nycphp-talk] $MyVAR vs. $_POST checkbox problems

betenoir at echonyc.com betenoir at echonyc.com
Fri Jul 11 02:20:21 EDT 2003


I'm passing form data from one page to another.

On the first page I

	session_start();
	session_destroy();
	session_unset();

	session_unregister('MyVAR');
	session_register('MyVAR');

To initialize my variables.

The input type for MyVAR is a checkbox.  The problem is that it seems to
"stick'.  Even though I run a javascript routine onSubmit to set and test
the value of the MyVAR on the subsequent page I get the "on" value.

On the second page I

	session_register('MyVAR');
	extract($_POST);

and set a cookie.

Then I test for the value of $MyVAR and

	print "<input type=hidden name=MyVAR value=\"$MyVAR\"> $MyVAR";

and the result is as if the checkbox were checked -- even when it's not.

This is making me crazy.

Suggestions?

Clyde




More information about the talk mailing list