Re: Session Variables
| From: | Seung Hwan Kang | Date: | Fri, 25 Apr 2003 04:45:49 +0000 |
| Subject: | Re: Session Variables | ||
| References: | 1 2 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-19606@lists.php.net to get a copy of this message | ||
<?php
// sess.php
// Registering a variable with $_SESSION
session_start();
$_SESSION['sess'] = 100;
?>
<?php
// sess1.php
session_start();
echo $_SESSION['sess'];
?>
Harpreet wrote:
I tried using mssql_pconnect When i use the $connection session variable in the mssql_select_db('database', $connection) on the second page it says Notice: Undefined variable: connection in e:\INetPub\WWWRoot\traffic.inc on line 1 How can I get the sessions to work in all the pages. Please help ----- Original Message ----- From: "AP Fritts" <php@apwebd.com> To: "Harpreet" <harpreet@crispincorp.com> Sent: Thursday, April 24, 2003 3:39 PM Subject: Re: [PHP-WIN] Session Variablesyou can't store database connections as far as i know, but you can open apermenant one, mysql_pconnect(server,username,password) that will stay open forever. Any script that needs that connection to the server will have it.---------- Original Message ---------------------------------- From: "Harpreet" <harpreet@crispincorp.com> Date: Thu, 24 Apr 2003 14:08:30 -0400useI can connect to sql server database using mssql_connect. I am trying totothe same connection saved as a session variable to be used again on the second page. But i get an error saying connection to database not open. It seems like i cant use the session variables on the next page and haveredefine it on each page or hard code the connection on each page. Please help I am stuck on this issue. Thanks, Regards, Harpreet -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php