using require or include?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



i have made a page (overall.php) in which several elements are defined:
the connection with the database
a function called session_checker to check if users are logged in
and a last function(function getuserinfo()) that substracts values from
the database based on the session variables of the logged in user
 
Now this last function sets 2 variables eg.
$username=$row['user_name'];
$userstatus=$row['user_status'];
like this i do not have to recall this script on every page but i just
can do the function at the top of every page
 
Now on every page of my site I require this file
require(overall.php);
 
But it seems that i cannot get the variables outta this file.
So i can not use $username or $userstatus on the pages.
 
I think it has something to do with require not passing the variables?
Off course i can repeat the function script on the top of every page,
but that's stupid i think.
Can i use a include without any problems? Or is there a significant
difference in use and security?
 
Thx in advance
Reinhart
 
 
  _____  

Reinhart Viane 
 <mailto:rv@xxxxxxxx> rv@xxxxxxxx 
Domos || D-Studio 
Graaf Van Egmontstraat 15/3 -- B 2800 Mechelen -- tel +32 15 44 89 01 --
fax +32 15 43 25 26 


STRICTLY PERSONAL AND CONFIDENTIAL 
This message may contain confidential and proprietary material for the
sole use of the intended 
recipient.  Any review or distribution by others is strictly prohibited.
If you are not the intended 
recipient please contact the sender and delete all copies.

 

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux