Login
Register
All class groups
Latest entries
Top 10 charts
Blog
Forums
Shop
Help
Login
Register
how to use this in a custom function
Search
All class groups
Latest entries
Top 10 charts
Blog
Forums
Shop
Help
Recommend
this page to a friend!
My Session
>
All threads
>
how to use this in a custom function
>
(Un) Subscribe thread alerts
Subject:
how to use this in a custom function
Summary:
how to use this in a custom function
Messages:
2
Author:
leocrawf stewart
Date:
2012-11-09 06:50:48
Update:
2012-11-21 10:55:07
1. how to use this in a custom function
Reply
Report abuse
leocrawf stewart - 2012-11-09 06:50:48
I want to use this in a custom function but it does not work. here is my code:
require_once('../../includes/mySession.class.php');
require_once('../../includes/mySession.conf.php');
$session = mySession::getIstance($_MYSESSION_CONF);
function customFunction(){
//get custom db connection
$session->save("foo","bar");
}
I get a "Undefined variable: session";
2. Re: how to use this in a custom function
Reply
Report abuse
Jaroslav - 2012-11-21 10:55:07 -
In reply to
message 1
from leocrawf stewart
Hi,
try
function customFunction($session){
//get custom db connection
$session->save("foo","bar");
}
or
function customFunction($session){
global $session;
//get custom db connection
$session->save("foo","bar");
}
;)
About us
Advertise on this site
Site map
Newsletter
Statistics
Site tips
Privacy policy
Contact
Copyright (c)
Icontem
1999-2025
For more information send a message to
info at phpclasses dot org
.
image/svg+xml
image/svg+xml
Contact us using Messenger