on 7/3/01 12:19 AM, Victor Spång Arthursson at [EMAIL PROTECTED]
wrote:
> Hi!
>
> I'm converting from ASP/VBScript, and need to know how to declare a
> session variable.
i feel your pain. i just finished moving a site from ASP/VBScript to
PHP/Javascript, learning ASP/VBScript and Javascript along the way :)
>
> In VBScript I just type in:
>
> <%
> session("any") = "victor"
> %>
>
> Then I can print that variable on any page on the same webpage using:
>
> <%
> response.write session("any")
> %>
>
> as long as I don't close the browser or the variable times out.
>
> Question: How do I achieve the same thing in PHP..?
you'll want to take a look at http://www.php.net/manual/en/ref.session.php
you can start a session by starting it or by registering a variable.
session_start()
session_register("variablename")
once set, the variables are available as $HTTP_SESSION_VARS["variablename"]
or (depending on how php is configured) $variablename.
on my macos x box, $variablename does work.
>
> Thanks in advance,
>
> Sincerely Victor
>
> PS Using PHP 4 on Mac OS X DS
-- mike cullerton
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]