467,104 Members | 1,044 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,104 developers. It's quick & easy.

Session variable in include file

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
  • viewed: 3023
Share:
1 Reply
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.

Similar topics

1 post views Thread by Paul | last post: by
3 posts views Thread by Michael J. Astrauskas | last post: by
3 posts views Thread by Peter Redding | last post: by
1 post views Thread by Sean Pinto | last post: by
3 posts views Thread by Geoff Winsor | last post: by
1 post views Thread by farooqazeem | last post: by
10 posts views Thread by sheldonlg | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.