RE: [PHP-WIN] SESSIONS and include()
| From: | Luis Moreira | Date: | Thu, 09 Feb 2006 09:03:40 +0000 |
| Subject: | RE: [PHP-WIN] SESSIONS and include() | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-26687@lists.php.net to get a copy of this message | ||
Actually it does not make that much sense.
I use includes, with PHP extension, and never had a problem.
Take a look at how you communicate between modules, ergo if you have globals
on or off, the scope of variables, etc.
It seems as if "user_level" is not known within the module.
Luis
-----Original Message-----
From: Armando [mailto:dijital@shaw.ca]
Sent: quinta-feira, 9 de Fevereiro de 2006 4:41
To: php-windows@lists.php.net
Subject: Re: [PHP-WIN] SESSIONS and include()
Read the user post (currently 2nd) from greatmagicalhat [at] gmail [dot]
com at the link below. I've never tried including a php file myself so
cannot verify their information, but it makes sense. When I use
includes, I use a specific file extension and store the files in a
protected directory (so they are not just able to be viewed by browsing
directly to the file) and it works fine. If you do it with a different
file extension, make sure you configure your web server to make PHP
process pages with that extension. Cheers.
http://ca3.php.net/manual/en/function.include.php
Armando
Fredrik Tillman wrote:
> Hi
>
> PROBLEM:
>
> I want to let certain users use certain funcions on my page. To manage
> that I start a session and define $_SESSION[user_level] to a value from
> a mySQL table. So far so good. Users with $_SESSION[user_level]=="1" can
> access things on the .php page they are on. I made a simple if-statement
> to handle that.
>
> Now the problem is that i want to use include("page.php") and let the
> users with user_level=1 access special things on that included page. The
> if statements that let them change things work if I access the page
> directly from my browser but not when it is included in that main page.
>
> Whats am I missing?
>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php