|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-10-16 14:11 UTC] sas@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 12:00:01 2025 UTC |
<?php session_register("count"); printf("$count<BR>"); $count++; printf("$count"); printf("<BR>to count up <A HREF=index.php>Click Here</A> ?> With cookies on everything works.. PHP does add a proper PHPSESSID to the url, however its adding 2 to count every time to click on the page.. Normal strings are saved just fine.. no changes as you click on the link.. If you do not do the $count++ the number does not change at all.. Its only during a change of the number within a session does it mess up... By checking the session tmp file I found the bug happens during the storing off data... session_register does pull the current value within the session tmp file.. However when you change the value of count, a incorrect value is stored.. $count = 10; always returns and stores the number 10.. I made $count = 1, then changes $count++ to $count = $count * 2 Expected results should of been 2 8 16 32 Instead 2 in 2 out 4 in 16 out 32 in 128 out Bottom line it seems I print the last value of count, yet if I made any math changes to count that value is not the value stored If you use a normal string and change it, say from hi, to hello it works, seems to only affect number values note... $count + 1 it stores $count + 2 $count * 2 it stores $count * 4 Somewhere it seems to be redoing the math before storing the number.. With cookies on everything works fine..