Article View: ba.php
Article #82[PHP3] Sessions thru PHPLib-7.2c
From: KTXRudy
Date: Mon, 07 Aug 2000 00:00
Date: Mon, 07 Aug 2000 00:00
194 lines
7822 bytes
7822 bytes
This is a multi-part message in MIME format.
------=_NextPart_000_003F_01C00066.7FBCD5C0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Greetings everyone...
I have a question regarding the proper usage of sessions in PHPLib-7.2c =
for persistency of variables.
At the site http://www.phpbuilder.com
in the article titled "Session Management and Authentication with =
PHPLIB" there is an explanation of how session variables can be setup =
and used.
However, following that explanation, and the examples in the PHPLib =
distributables, I cannot get my session variables to work.
Could some please set me straight on this if I am getting this wrong?
Now, the following is the simple test code that I using. NOTE: I am =
doing auto_prepend =3D prepend.php3 and my local.inc definition for =
database name is "sessions" .
file: PageOne.php
<?php
page_open(array("sess"=3D>"MySessions")); // MySessions in my =
classname...sessions is my database name
$sess->register("name");
?>
<html>
<body>
<form id=3D"oForm" action=3D"PageTwo.php" method=3D"GET">
<?php
echo "<input id=3D\"szName\" type=3D\"text\">Name:<br>";
$name =3D $szName;
?>
<input id=3D"oButton" type=3D"submit" value=3D"Press ME">
</form>
</form>
</body>
</html>
<?php
page_close();
?>
-------------------------------------------------------------------------=
-------
file: PageTwo.php
<?php
page_open(array("sess"=3D>"MySessions"));=20
?>
<html>
<?php
echo "My Name =3D $name";
?>
<body>
</body>
</html>
<?php
page_close();
?>
------=_NextPart_000_003F_01C00066.7FBCD5C0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#c0c0c0>
<DIV>Greetings everyone...</DIV>
<DIV> </DIV>
<DIV>I have a question regarding the proper usage of sessions in =
PHPLib-7.2c for=20
persistency of variables.</DIV>
<DIV> </DIV>
<DIV>At the site <A=20
href=3D"http://www.phpbuilder.com">http://www.phpbuilder.com</A></DIV>
<DIV>in the article titled "Session Management and Authentication with =
PHPLIB"=20
there is an explanation of how session variables can be setup and =
used.</DIV>
<DIV> </DIV>
<DIV>However, following that explanation, and the examples in the PHPLib =
distributables, I cannot get my session variables to work.</DIV>
<DIV> </DIV>
<DIV>Could some please set me straight on this if I am getting this =
wrong?</DIV>
<DIV> </DIV>
<DIV>Now, the following is the simple test code that I using. =
NOTE: I am=20
doing auto_prepend =3D prepend.php3 and my local.inc definition for =
database name=20
is "sessions" .</DIV>
<DIV> </DIV>
<BLOCKQUOTE style=3D"MARGIN-RIGHT: 0px">
<DIV><STRONG><FONT face=3D"Lucida Console">file: =20
PageOne.php</FONT></STRONG></DIV>
<DIV> </DIV>
<DIV><STRONG><FONT face=3D"Lucida =
Console"><?php</FONT></STRONG></DIV>
<DIV><STRONG><FONT face=3D"Lucida Console"> =20
page_open(array("sess"=3D>"MySessions")); // MySessions in my =
classname...sessions is my database name</FONT></STRONG></DIV>
<DIV> </DIV>
<DIV><STRONG><FONT face=3D"Lucida Console"> =20
$sess->register("name");</FONT></STRONG></DIV>
<DIV><STRONG><FONT face=3D"Lucida Console">?></FONT></STRONG></DIV>
<DIV><STRONG><FONT face=3D"Lucida =
Console"><html></FONT></STRONG></DIV>
<DIV><STRONG><FONT face=3D"Lucida =
Console"><body></FONT></STRONG></DIV>
<DIV><STRONG><FONT face=3D"Lucida Console"><form id=3D"oForm"=20
action=3D"PageTwo.php" method=3D"GET"></FONT></STRONG></DIV>
<DIV><STRONG><FONT face=3D"Lucida =
Console"><?php</FONT></STRONG></DIV>
<DIV><STRONG><FONT face=3D"Lucida Console"> echo =
"<input=20
id=3D\"szName\" =
type=3D\"text\">Name:<br>";</FONT></STRONG></DIV>
<DIV><STRONG><FONT face=3D"Lucida Console"> $name =
=3D=20
$szName;</FONT></STRONG></DIV>
<DIV><STRONG><FONT face=3D"Lucida Console">?></FONT></STRONG></DIV>
<DIV><STRONG><FONT face=3D"Lucida Console"><input id=3D"oButton" =
type=3D"submit"=20
value=3D"Press ME"></FONT></STRONG></DIV>
<DIV><STRONG><FONT face=3D"Lucida =
Console"></form></FONT></STRONG></DIV>
<DIV><STRONG><FONT face=3D"Lucida =
Console"></form></FONT></STRONG></DIV>
<DIV><STRONG><FONT face=3D"Lucida =
Console"></body></FONT></STRONG></DIV>
<DIV><STRONG><FONT face=3D"Lucida =
Console"></html></FONT></STRONG></DIV>
<DIV><STRONG><FONT face=3D"Lucida =
Console"><?php</FONT></STRONG></DIV>
<DIV><STRONG><FONT face=3D"Lucida Console"> =20
page_close();</FONT></STRONG></DIV>
<DIV><FONT face=3D"Lucida Console"><STRONG>?></STRONG></FONT></DIV>
<DIV> </DIV></BLOCKQUOTE>
<DIV>
<HR>
</DIV>
<BLOCKQUOTE style=3D"MARGIN-RIGHT: 0px">
<DIV> </DIV>
<DIV><FONT face=3D"Lucida Console"><STRONG>file: =20
PageTwo.php</STRONG></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3D"Lucida =
Console"><STRONG><?php</STRONG></FONT></DIV>
<DIV><STRONG><FONT face=3D"Lucida Console"> =20
page_open(array("sess"=3D>"MySessions")); </FONT></STRONG></DIV>
<DIV><FONT face=3D"Lucida Console"><STRONG>?></STRONG></FONT></DIV>
<DIV><FONT face=3D"Lucida =
Console"><STRONG><html></STRONG></FONT></DIV>
<DIV><FONT face=3D"Lucida =
Console"><STRONG><?php</STRONG></FONT></DIV>
<DIV><STRONG><FONT face=3D"Lucida Console"> echo "My =
Name =3D=20
$name";</FONT></STRONG></DIV>
<DIV><FONT face=3D"Lucida Console"><STRONG>?></STRONG></FONT></DIV>
<DIV><FONT face=3D"Lucida =
Console"><STRONG><body></STRONG></FONT></DIV>
<DIV><FONT face=3D"Lucida =
Console"><STRONG></body></STRONG></FONT></DIV>
<DIV><FONT face=3D"Lucida =
Console"><STRONG></html></STRONG></FONT></DIV>
<DIV><FONT face=3D"Lucida =
Console"><STRONG><?php</STRONG></FONT></DIV>
<DIV><STRONG><FONT face=3D"Lucida Console"> =20
page_close();</FONT></STRONG></DIV>
<DIV><FONT=20
face=3D"Lucida Console"><STRONG>?></STRONG></FONT></DIV></BLOCKQUOTE>
<DIV> </DIV></BODY></HTML>
------=_NextPart_000_003F_01C00066.7FBCD5C0--
Technical Details
Message-ID:
<PDDj5.25063$0W4.610729@newsread2.prod.itd.earthlink.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fce7d,877522ea558a05a4,start X-Google-Attributes: gidfce7d,public X-Google-Thread: 108904,877522ea558a05a4,start X-Google-Attributes: gid108904,public X-Google-Thread: 10ce1c,877522ea558a05a4,start X-Google-Attributes: gid10ce1c,public From: "KTXRudy" <raygunprez@earthlink.net> Subject: [PHP3] Sessions thru PHPLib-7.2c Date: 2000/08/07 Message-ID: <PDDj5.25063$0W4.610729@newsread2.prod.itd.earthlink.net> X-Deja-AN: 655526567 X-Priority: 3 Content-Type: multipart/alternative; boundary="----=_NextPart_000_003F_01C00066.7FBCD5C0" X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 965674607 198.102.112.18 (Mon, 07 Aug 2000 11:56:47 PDT) Organization: EarthLink Inc. -- http://www.EarthLink.net X-MSMail-Priority: Normal MIME-Version: 1.0 Reply-To: "KTXRudy" <raygunprez@earthlink.net> NNTP-Posting-Date: Mon, 07 Aug 2000 11:56:47 PDT Newsgroups: ba.php,mailing.www.php-dev,mailing.www.php-user