PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.general > SESSION variables
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
SESSION variables

Réponse
 
LinkBack Outils de la discussion
Vieux 12/10/2008, 01h49   #1
Ron Piggott
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut SESSION variables

I am programming a blog.

index.php sets up the layout for the web page. This includes the
heading, left hand and bottom menus.

The content is loaded by the command:

include($filename);

the $_SESSION variables aren't available to files like blog.php . The
session variables only work in the initial file, index.php.

I am NOT using frames. The web page is loaded all at the same time.
Simply when index.php is done, it passes the "baton" to the next .php
file to display the specific information the user is requesting.

Any ideas / suggestions?

Ron

  Réponse avec citation
Vieux 12/10/2008, 01h59   #2
Daniel Brown
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] SESSION variables

On Sat, Oct 11, 2008 at 7:49 PM, Ron Piggott <ron.php@actsministries.org> wrote:
> I am programming a blog.
>
> index.php sets up the layout for the web page. This includes the
> heading, left hand and bottom menus.
>
> The content is loaded by the command:
>
> include($filename);
>
> the $_SESSION variables aren't available to files like blog.php . The
> session variables only work in the initial file, index.php.


Did you remember to add session_start() to the head of the master
file that's including the other files?

--
</Daniel P. Brown>
More full-root dedicated server packages:
Intel 2.4GHz/60GB/512MB/2TB $49.99/mo.
Intel 3.06GHz/80GB/1GB/2TB $59.99/mo.
Intel 2.4GHz/320/GB/1GB/3TB $74.99/mo.
Dedicated servers, VPS, and hosting from $2.50/mo.
  Réponse avec citation
Vieux 12/10/2008, 02h28   #3
Ron Piggott
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] SESSION variables


This is one of the first commands given.

I am using modrewrites to call the blog entries.

blog.php is responsible for displaying both the table of contents and
the blog entries. When the table of contents is called
(http://www.rons-home.net/page/blog/ ) the session variables are
present. When an actual blog entry is displayed
( http://www.rons-home.net/blog/28/ ) the session variables aren't
there.

I am not sure what is happening / why.

The login is at http://www.rons-home.net/page/login/ It has 'page' in
the URL. But I am not sure why this should upset the session
variables ...

Any thoughts?

Ron

On Sat, 2008-10-11 at 19:59 -0400, Daniel Brown wrote:
> On Sat, Oct 11, 2008 at 7:49 PM, Ron Piggott <ron.php@actsministries.org> wrote:
> > I am programming a blog.
> >
> > index.php sets up the layout for the web page. This includes the
> > heading, left hand and bottom menus.
> >
> > The content is loaded by the command:
> >
> > include($filename);
> >
> > the $_SESSION variables aren't available to files like blog.php . The
> > session variables only work in the initial file, index.php.

>
> Did you remember to add session_start() to the head of the master
> file that's including the other files?
>


  Réponse avec citation
Vieux 12/10/2008, 03h12   #4
Ron Piggott
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] SESSION variables

I did some more testing. The URL is the problem.

Logins are from


On Sat, 2008-10-11 at 19:59 -0400, Daniel Brown wrote:
> On Sat, Oct 11, 2008 at 7:49 PM, Ron Piggott <ron.php@actsministries.org> wrote:
> > I am programming a blog.
> >
> > index.php sets up the layout for the web page. This includes the
> > heading, left hand and bottom menus.
> >
> > The content is loaded by the command:
> >
> > include($filename);
> >
> > the $_SESSION variables aren't available to files like blog.php . The
> > session variables only work in the initial file, index.php.

>
> Did you remember to add session_start() to the head of the master
> file that's including the other files?
>


  Réponse avec citation
Vieux 12/10/2008, 03h13   #5
Ron Piggott
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] SESSION variables

Oops

Logins are from

http://www.rons-home.net/page/login-greeting/

Blog postings are from

http://www.rons-home.net/blog/28/

with the word 'page' gone the session variable doesn't acknowledge the
login.

Ron


On Sat, 2008-10-11 at 21:12 -0400, Ron Piggott wrote:
> I did some more testing. The URL is the problem.
>
> Logins are from
>
>
> On Sat, 2008-10-11 at 19:59 -0400, Daniel Brown wrote:
> > On Sat, Oct 11, 2008 at 7:49 PM, Ron Piggott <ron.php@actsministries.org> wrote:
> > > I am programming a blog.
> > >
> > > index.php sets up the layout for the web page. This includes the
> > > heading, left hand and bottom menus.
> > >
> > > The content is loaded by the command:
> > >
> > > include($filename);
> > >
> > > the $_SESSION variables aren't available to files like blog.php . The
> > > session variables only work in the initial file, index.php.

> >
> > Did you remember to add session_start() to the head of the master
> > file that's including the other files?
> >

--

Acts Ministries Christian Evangelism
Where People Matter
12 Burton Street
Belleville, Ontario, Canada
K8P 1E6

ron.piggott@actsministries.org
www.actsministrieschristianevangelism.org

In Belleville Phone: (613) 967-0032
In North America Call Toll Free: (866) ACTS-MIN
Fax: (613) 967-9963

  Réponse avec citation
Vieux 13/10/2008, 14h08   #6
mrclay
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SESSION variables

> with the word 'page' gone the session variable doesn't acknowledge the login.

Session is a pretty simple system. session_start() maintains a browser
and a file on your server. If either is not found, or
session_start() isn't called, $_SESSION is empty.

1. session_start() must be called in every script
2. in all scripts http://www.php.net/manual/en/session.configuration.php
should be identical, particularly save_path

Steve
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 17h08.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,12717 seconds with 14 queries