Problem when printing a SELECT list

From: Date: Fri, 08 Sep 2000 17:09:11 +0000
Subject: Problem when printing a SELECT list
Groups: php.general 
Request: Send a blank email to php-general+get-15910@lists.php.net to get a copy of this message
Hello I have a php script containing a SELECT list with a pre-selected option. A PHP 4 session is opened with session_start at the beginning of the same script. Using Netscape 4.7, the combo box is correctly displayed, but when I print (or preview) it, the printed value is always the first one, not the selected one. The problem doesn't occur when session_start is not called at the beginning of the script. It runs OK with IE 5. PHP version is PHP 4.0.1 pl2 (either on Apache/Linux or PWS/WinNT). It's a problem for me because I have a page with several lists and I'd like people to be able to print the current selected values. Any ideas appreciated ! Gilles Tran Here is a sample of code that causes the problem : <?php if ($PHPSESSID) { session_start($PHPSESSID); } else { session_start(); session_register("SESSION"); } ?> <html> <head><title>Test</title></head> <body> <form method="get" action=""><SELECT name="test" size=1> <OPTION VALUE=0>0</OPTION> <OPTION VALUE=1>1</OPTION> <OPTION VALUE=2 SELECTED>2</OPTION> <OPTION VALUE=3>3</OPTION> </select></form> </body> </html>

« previous php.general (#15910) next »