Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #10444
| From | Twayne <nobody@spamcop.net> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | Re: Counter reset or not? |
| Date | 2013-08-08 12:19 -0400 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <ku0ge6$f78$1@speranza.aioe.org> (permalink) |
| References | <ktulqb$rmk$1@speranza.aioe.org> <ZOEMt.6704$Mq1.3256@en-nntp-05.dc1.easynews.com> |
On 2013-08-08 12:06 AM, Richard Damon wrote:
> On 8/7/13 7:38 PM, Twayne wrote:
>> Hi all,
>>
>> I'm confused; this code isn't working and I don't know why; perhaps you
>> can tell me or at least point me in the right direction:
>>
>> <code>
>> if($_SESSION["cntr"] > "0") {
>> echo "Count is now : " . $_SESSION["cntr"]." ";
>> }
>> ELSE {
>> $_SESSION['cntr']="0";
>> $cntr=$_SESSION['cntr'];
>> echo "Counter : " . $cntr."<br />";
>> }
>> </code>
>>
>> OK: This code is on the first of 3 PHP form pages. The ELSE works fine.
>> If the count is zero, the initial count of "0" is echoed properly.
>>
>> But if the code is 1 or greater, set on one of the two succeeding pages,
>> it still runs the ELSE code and insists on returning the value of "0".
>>
>> I'm not using session_destroy, nor an I using die(), exit() or anything
>> else that should bother the SESSION var.
>> 2. If the counter advances to 1 or more, however, when I send the user
>> back to the first page (where the above code resides), it still prints
>> the ELSE portion of the code, NOT what the SESSION var has been set to
>> (1 or greater).
>>
>> I'm confused!! What am I doing wrong?
>>
>> TIA,
>>
>> Twayne`
>> O
>
> Have you called session_start() (or set session.auto_start) ?
>
Yes; session_start(). set session.auto_start I wasn't aware of though;
something else to check out.
Thanks much,
Twayne
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Counter reset or not? Twayne <nobody@spamcop.net> - 2013-08-07 19:38 -0400
Re: Counter reset or not? Richard Yates <richard@yatesguitar.com> - 2013-08-07 20:30 -0700
Re: Counter reset or not? Twayne <nobody@spamcop.net> - 2013-08-08 12:15 -0400
Re: Counter reset or not? Richard Yates <richard@yatesguitar.com> - 2013-08-10 05:49 -0700
Re: Counter reset or not? Twayne <nobody@spamcop.net> - 2013-08-08 15:13 -0400
Re: Counter reset or not? Richard Damon <Richard@Damon-Family.org> - 2013-08-08 00:06 -0400
Re: Counter reset or not? Twayne <nobody@spamcop.net> - 2013-08-08 12:19 -0400
Re: Counter reset or not? Twayne <nobody@spamcop.net> - 2013-08-08 15:14 -0400
Re: Counter reset or not? UPDATE Twayne <nobody@spamcop.net> - 2013-08-08 15:10 -0400
Re: Counter reset or not? UPDATE Scott Johnson <noonehome@chalupasworld.com> - 2013-08-08 15:28 -0700
Re: Counter reset or not? UPDATE Christoph Michael Becker <cmbecker69@arcor.de> - 2013-08-09 00:58 +0200
Re: Counter reset or not? UPDATE Jerry Stuckle <jstucklex@attglobal.net> - 2013-08-08 20:44 -0400
Re: Counter reset or not? UPDATE Twayne <nobody@spamcop.net> - 2013-08-09 14:07 -0400
Re: Counter reset or not? UPDATE Twayne <nobody@spamcop.net> - 2013-08-09 14:05 -0400
csiph-web