Another newbie session variable question

Another newbie session variable question

am 04.08.2007 05:09:44 von Big Moxy

I have a form variable that is set to a default value in the beginning
of a multi-page process. Along the way, a user can optionally update/
null out that field. Before the final page is rendered I would like to
blank out other variables that may have still have their default
values or updated by the user and are now meaningless.

I wanted to do this but my last page no longer renders. Can I do the
following?

if ($_SESSION['phrase'] == "" {
$_SESSION['font_type'] = "^^no^^";
$_SESSION['thread_color'] = "^^no^^";
}

I have also tried this but again the last page no longer renders.

if ($_SESSION['phrase'] == "" {
$font_type = "^^no^^";
$thread_color = "^^no^^";
}

Re: Another newbie session variable question

am 06.08.2007 04:31:27 von kurt.milligan

On Aug 3, 11:09 pm, Big Moxy wrote:
[snip]
>
> I wanted to do this but my last page no longer renders. Can I do the
> following?
>
> if ($_SESSION['phrase'] == "" {
> $_SESSION['font_type'] = "^^no^^";
> $_SESSION['thread_color'] = "^^no^^";
>
> }
>

I may be missing something, but did you just forget to put in a
closing parenthesis?
(though I would think that you would be getting a parse error from
PHP)

if ($_SESSION['phrase'] == "") { // <<< missing ) after the ""

-K