RE: [PHP] Help needed with Sessions
| From: | Johnson, Kirk | Date: | Tue, 26 Feb 2002 15:27:21 +0000 |
| Subject: | RE: [PHP] Help needed with Sessions | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-86255@lists.php.net to get a copy of this message | ||
Start here: http://www.php.net/manual/en/ref.session.php
You will need to call session_start() to initiate the session. You will also
need to register the variables you want in the session with
session_register().
Good luck!
Kirk
> -----Original Message-----
> From: WG4- Cook, Janet [mailto:JCook@ICO.NEC.COM.AU]
> Sent: Monday, February 25, 2002 10:06 PM
> To: PHP List
> Subject: [PHP] Help needed with Sessions
>
>
> Hi all,
> I am trying to get sessions to work to use to pass some data
> around, but the
> values do not seem to be coming through - I've probably got
> something basic
> wrong
>
> PHP version is 4.0.4pl1
>
> sources are
>
> validate.php
>
>
> <?php
> include("header.inc");
> ?>
>
> <HTML>
> <HEAD>
> <TITLE>Today's Date</TITLE>
> </HEAD>
> <BODY>
>
> <?php
>
> $dbcnx=@mysql_connect("localhost","root","");
> echo ( "<P> Connection established on $dbcnx</P>");
> if (!$dbcnx) {
> echo( "<P>Unable to connect to MySql Server at this time.</P>");
> exit();
> }
> else
> { echo ("<P>Connected to My Sql Server on connection $dbcnx.</P>");
> };
>
>
> if (! mysql_select_db("DMS", $dbcnx)) {
> echo( "<P>Unable to connect to DMS database at this time.</P>");
> exit();
> }
> else
> { echo( "Established connection to DMS db");
> };
>
> $whoid=10;
>
> ?>
>
> <A HREF=jtest.php?name="3"?>testlink</A>
>
> </BODY>
> </HTML>
>
>
>
> and in jtest.php I have
>
> <?php
> include("header.inc");
> ?>
>
> <?php
> echo "In jtest values are $dbcnx $whoid";
>
>
> ?>
>
> The connection establishes, but the values do not appear to
> be there in the
> jtest page?
>
> Any ideas
>
> Thanks
> Janet
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>