🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by KTXRudy Mon, 07 Aug 2000 00:00
[PHP3] Sessions thru PHPLib-7.2c
#82
Author: KTXRudy
Date: Mon, 07 Aug 2000 00:00
194 lines
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>&nbsp;</DIV>
<DIV>I have a question regarding the proper usage of sessions in =
PHPLib-7.2c for=20
persistency of variables.</DIV>
<DIV>&nbsp;</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>&nbsp;</DIV>
<DIV>However, following that explanation, and the examples in the PHPLib =

distributables, I cannot get my session variables to work.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Could some please set me straight on this if I am getting this =
wrong?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Now, the following is the simple test code that I using.&nbsp; =
NOTE: I am=20
doing auto_prepend =3D prepend.php3 and my local.inc definition for =
database name=20
is "sessions" .</DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE style=3D"MARGIN-RIGHT: 0px">
  <DIV><STRONG><FONT face=3D"Lucida Console">file:&nbsp;=20
  PageOne.php</FONT></STRONG></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><STRONG><FONT face=3D"Lucida =
Console">&lt;?php</FONT></STRONG></DIV>
  <DIV><STRONG><FONT face=3D"Lucida Console">&nbsp;&nbsp;&nbsp;=20
  page_open(array("sess"=3D&gt;"MySessions")); //&nbsp; MySessions in my =

  classname...sessions is my database name</FONT></STRONG></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><STRONG><FONT face=3D"Lucida Console">&nbsp;&nbsp;&nbsp;=20
  $sess-&gt;register("name");</FONT></STRONG></DIV>
  <DIV><STRONG><FONT face=3D"Lucida Console">?&gt;</FONT></STRONG></DIV>
  <DIV><STRONG><FONT face=3D"Lucida =
Console">&lt;html&gt;</FONT></STRONG></DIV>
  <DIV><STRONG><FONT face=3D"Lucida =
Console">&lt;body&gt;</FONT></STRONG></DIV>
  <DIV><STRONG><FONT face=3D"Lucida Console">&lt;form id=3D"oForm"=20
  action=3D"PageTwo.php" method=3D"GET"&gt;</FONT></STRONG></DIV>
  <DIV><STRONG><FONT face=3D"Lucida =
Console">&lt;?php</FONT></STRONG></DIV>
  <DIV><STRONG><FONT face=3D"Lucida Console">&nbsp;&nbsp;&nbsp; echo =
"&lt;input=20
  id=3D\"szName\" =
type=3D\"text\"&gt;Name:&lt;br&gt;";</FONT></STRONG></DIV>
  <DIV><STRONG><FONT face=3D"Lucida Console">&nbsp;&nbsp;&nbsp; $name =
=3D=20
  $szName;</FONT></STRONG></DIV>
  <DIV><STRONG><FONT face=3D"Lucida Console">?&gt;</FONT></STRONG></DIV>
  <DIV><STRONG><FONT face=3D"Lucida Console">&lt;input id=3D"oButton" =
type=3D"submit"=20
  value=3D"Press ME"&gt;</FONT></STRONG></DIV>
  <DIV><STRONG><FONT face=3D"Lucida =
Console">&lt;/form&gt;</FONT></STRONG></DIV>
  <DIV><STRONG><FONT face=3D"Lucida =
Console">&lt;/form&gt;</FONT></STRONG></DIV>
  <DIV><STRONG><FONT face=3D"Lucida =
Console">&lt;/body&gt;</FONT></STRONG></DIV>
  <DIV><STRONG><FONT face=3D"Lucida =
Console">&lt;/html&gt;</FONT></STRONG></DIV>
  <DIV><STRONG><FONT face=3D"Lucida =
Console">&lt;?php</FONT></STRONG></DIV>
  <DIV><STRONG><FONT face=3D"Lucida Console">&nbsp;&nbsp;&nbsp;=20
  page_close();</FONT></STRONG></DIV>
  <DIV><FONT face=3D"Lucida Console"><STRONG>?&gt;</STRONG></FONT></DIV>
  <DIV>&nbsp;</DIV></BLOCKQUOTE>
<DIV>
<HR>
</DIV>
<BLOCKQUOTE style=3D"MARGIN-RIGHT: 0px">
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=3D"Lucida Console"><STRONG>file:&nbsp;=20
  PageTwo.php</STRONG></FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=3D"Lucida =
Console"><STRONG>&lt;?php</STRONG></FONT></DIV>
  <DIV><STRONG><FONT face=3D"Lucida Console">&nbsp;&nbsp;&nbsp;=20
  page_open(array("sess"=3D&gt;"MySessions")); </FONT></STRONG></DIV>
  <DIV><FONT face=3D"Lucida Console"><STRONG>?&gt;</STRONG></FONT></DIV>
  <DIV><FONT face=3D"Lucida =
Console"><STRONG>&lt;html&gt;</STRONG></FONT></DIV>
  <DIV><FONT face=3D"Lucida =
Console"><STRONG>&lt;?php</STRONG></FONT></DIV>
  <DIV><STRONG><FONT face=3D"Lucida Console">&nbsp;&nbsp;&nbsp; echo "My =
Name =3D=20
  $name";</FONT></STRONG></DIV>
  <DIV><FONT face=3D"Lucida Console"><STRONG>?&gt;</STRONG></FONT></DIV>
  <DIV><FONT face=3D"Lucida =
Console"><STRONG>&lt;body&gt;</STRONG></FONT></DIV>
  <DIV><FONT face=3D"Lucida =
Console"><STRONG>&lt;/body&gt;</STRONG></FONT></DIV>
  <DIV><FONT face=3D"Lucida =
Console"><STRONG>&lt;/html&gt;</STRONG></FONT></DIV>
  <DIV><FONT face=3D"Lucida =
Console"><STRONG>&lt;?php</STRONG></FONT></DIV>
  <DIV><STRONG><FONT face=3D"Lucida Console">&nbsp;&nbsp;&nbsp;=20
  page_close();</FONT></STRONG></DIV>
  <DIV><FONT=20
face=3D"Lucida Console"><STRONG>?&gt;</STRONG></FONT></DIV></BLOCKQUOTE>
<DIV>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_003F_01C00066.7FBCD5C0--
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads