ID: 21083 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Bogus Bug Type: Session related Operating System: Win98SE PHP Version: 4.2.3 New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Thank you for your interest in PHP. Previous Comments: ------------------------------------------------------------------------ [2002-12-18 14:29:49] [EMAIL PROTECTED] Here's the script that works both Linux&Win98SE session_start(); if(!session_is_registered('ind')) { $ind = 0; session_register('ind'); session_register("table[$ind]"); $_SESSION["table[$ind]"] = 1; } else { $ind = $_SESSION['ind']; //Lisätään alkio tauluun session_register("table[$ind]"); $_SESSION["table[$ind]"] = 1; } //increases the index $ind++; $_SESSION['ind'] = $ind; $i= 0 ; //prints all the data in $table while ($i < $ind) { print($_SESSION["table[$i]"] . "<br>"); $i++; } ------------------------------------------------------------------------ [2002-12-18 13:40:16] [EMAIL PROTECTED] First here's the whole script: <?php session_start(); if(!session_is_registered('ind')) { $ind = 0; session_register('ind'); $table[$ind] = 1; session_register("table"); } else { $ind = $_SESSION['ind']; //Lisätään alkio tauluun $table[$ind] = 1; session_register("table"); } //increases the index $ind++; $_SESSION['ind'] = $ind; $i= 0 ; //prints all the data in $table while ($i < $ind) { print("$table[$i]<br>"); $i++; } ?> I have tested this script both Linux(script works perfectly) and Win98SE(doesn't work). Both have Apache and PHP 4.2.3. So I'm using session cookie $table where to store number 1 in each index. Index increases every time i press refresh. Script should print (after three refresh): 1 1 1 1 But with my Windows scripts prints (after three refresh): Notice: Undefined offset: 0 in c:\www\sessio_taulu_testi.php on line 32 Notice: Undefined offset: 1 in c:\www\sessio_taulu_testi.php on line 32 Notice: Undefined offset: 2 in c:\www\sessio_taulu_testi.php on line 32 1 When entering the script for the first time scripts prints correctly: 1 I have deleted the session file after each time I've executed the script, so that shouldn't be the problem. I would like to know what's the problem in here :) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=21083&edit=1