php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6783 Empty form used as a url make the session variables re-register and data is nul
Submitted: 2000-09-17 00:07 UTC Modified: 2000-10-12 08:55 UTC
From: apocalpse at apocalypse-zone dot com Assigned:
Status: Closed Package: *Function Specific
PHP Version: 4.0.1pl2 OS: FreeBSD 4.1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: apocalpse at apocalypse-zone dot com
New email:
PHP Version: OS:

 

 [2000-09-17 00:07 UTC] apocalpse at apocalypse-zone dot 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...

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-09-21 03:44 UTC] sniper@php.net
Have you tried php4.0.2 or preferrably the latest CVS or snapshot from http://snaps.php.net?


--Jani

 [2000-10-12 08:55 UTC] sniper@php.net
no feedback.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 00:01:30 2024 UTC