By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,747 Members | 2,011 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,747 IT Pros & Developers. It's quick & easy.

Session variable in include file

P: n/a
I can't seem to access sessions variables from include files.

If I use the include file like this it I cant get the session
variables:
<?php
session_start();
require("url/to/inc/file.php");
?>

If I enter the url to the include file in my address bar, I can get
the sessions variables.

james
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
james wrote:
I can't seem to access sessions variables from include files.

If I use the include file like this it I cant get the session
variables:
<?php
session_start();
require("url/to/inc/file.php");
?>

If I enter the url to the include file in my address bar, I can get
the sessions variables.


Don't require an URL!

require 'http://server.com/path/to/inc/file.php'; // WRONG
require '/var/www/htdocs/path/to/inc/file.php'; // ok
--
USENET would be a better place if everybody read: | to email me: use |
http://www.catb.org/~esr/faqs/smart-questions.html | my name in "To:" |
http://www.netmeister.org/news/learn2quote2.html | header, textonly |
http://www.expita.com/nomime.html | no attachments. |
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.