PHP 4.0 Bug #6783 Updated: Empty form used as a url make the session variables re-register and data is nul

From: Date: Thu, 12 Oct 2000 12:55:36 +0000
Subject: PHP 4.0 Bug #6783 Updated: Empty form used as a url make the session variables re-register and data is nul
Groups: php.dev 
Request: Send a blank email to php-dev+get-34780@lists.php.net to get a copy of this message
ID: 6783 Updated by: sniper Reported By: apocalpse@apocalypse-zone.com Status: Closed Bug Type: *Function Specific Assigned To: Comments: no feedback. Previous Comments: --------------------------------------------------------------------------- [2000-09-21 03:44:51] sniper@php.net Have you tried php4.0.2 or preferrably the latest CVS or snapshot from http://snaps.php.net? --Jani --------------------------------------------------------------------------- [2000-09-17 00:07:01] apocalpse@apocalypse-zone.com I have a script that uses a blank form field to allow the user to "continue shopping". Here's the code: print "<form method="post" name="contin" action="index.php">n"; print "<input type="submit" name="nada" value="Continue Shopping">n"; print "</form>n"; The form would send the information back to a switch statement, here's the statement: switch ($cat) { case "sympathy": include("headers/header_sympathy.html"); include("headers/instructions.html"); get_cardlist("sympathy"); include("headers/instructions_bottom.html"); include("headers/footer_all.html"); break; case "getwell": include("headers/header_getwell.html"); include("headers/instructions.html"); get_cardlist("getwell"); include("headers/instructions_bottom.html"); include("headers/footer_all.html"); break; case "guidance": include("headers/header_guidance.html"); include("headers/instructions.html"); get_cardlist("guidance"); include("headers/instructions_bottom.html"); include("headers/footer_all.html"); break; case "love": include("headers/header_love.html"); include("headers/instructions.html"); get_cardlist("love"); include("headers/instructions_bottom.html"); include("headers/footer_all.html"); break; case "birthday": include("headers/header_birthday.html"); include("headers/instructions.html"); get_cardlist("birthday"); include("headers/instructions_bottom.html"); include("headers/footer_all.html"); break; case "family": include("headers/header_family.html"); include("headers/instructions.html"); get_cardlist("family"); include("headers/instructions_bottom.html"); include("headers/footer_all.html"); break; case "friendship": include("headers/header_friendship.html"); include("headers/instructions.html"); get_cardlist("friendship"); include("headers/instructions_bottom.html"); include("headers/footer_all.html"); break; case "encouragement": include("headers/header_encouragement.html"); include("headers/instructions.html"); get_cardlist("encouragement"); include("headers/instructions_bottom.html"); include("headers/footer_all.html"); break; default: include("headers/home_ord.html"); include("headers/footer_home.html"); break; } Here's the way that I initialized my sessions: //start sessions session_start(); session_register("SESSION"); session_register("INVOICE"); session_register("PRICE"); /* initialize the SESSION variable if necessary */ if (!isset($SESSION)) { $SESSION = array(); } if (!isset($INVOICE)) { $INVOICE = array(); $INVOICE[] = rand(1, 99999999999); } if (!isset($PRICE)){ $PRICE = array(); } ?> What would happen is the client (netscape navigator only) would click on the continue shopping AFTER selecting one card to purchase. When the client when back to the main page the sessionid would be made again. It wasn't recognizing that there was another session already. The bug was only happening on Netscape Navigator 4.5 running on Mac OS 6.8 and Win 95. I've never seen anything like this and I have been using session functions since 4.0 came out. I would have sent this to the php-general list, but it wasn't a programming bug on my part. The sessions are getting blown away because of an empty form script. I had to change the form link to an <a href> link to make it keep the session data. The problem would only occur in NN 4.5 on Win95, and MacOS 6.8. If you get time to look at this can you please let me know what happens? The site it was happening on is http://www.deargreetingcards.com. The form is gone and i'm now using an <a href> tag. Thanks for the help!! And php is awesome for web pages... --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=6783

« previous php.dev (#34780) next »