RE: Re[2]: [PHP] Lost session variables still confounding me
| From: | Ford, Mike | Date: | Thu, 04 Nov 2004 12:59:06 +0000 |
| Subject: | RE: Re[2]: [PHP] Lost session variables still confounding me | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-201162@lists.php.net to get a copy of this message | ||
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm
On 04 November 2004 12:08, Stuart Felenstein wrote:
> --- "Ford, Mike" <M.Ford@leedsmet.ac.uk> wrote:
> > Page 3:
> >
> > if (count($myarray) > 5):
> > $_SESSION['arrayerr'] = "you have selected too many industries";
> > session_write_close();
> > header ("Location: Page2.php?".SID);
> > exit;
> > endif;
> >
> > Hope this helps.
>
> Mike, once again you've come through. This worked!
> But , let me ask, can it have anything to do with the
> endif ? I asked becasue I tried the
> session_write_close and the SID before with no
> success. Now that it's working , the only thing
> different is the endif; .
Doubt it -- that's just me using PHP's alternative syntax for control
structures; in fact, if the rest of your script uses {} control-structure
delimiters, you should really use them in the above instead of : and endif,
since it's strongly advised not to mix the two forms. I just much prefer
the :-endif form and sometimes write it without thinking when it might be
more appropriate to use the {} form.
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211