Sessions: Gotta loose my hair on this... *sigh*

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
derschamane
Forum Newbie
Posts: 6
Joined: Fri Dec 27, 2002 1:44 pm
Location: Austria
Contact:

Sessions: Gotta loose my hair on this... *sigh*

Post by derschamane »

Seems to be a simple problem

First Page: Login-Form (Login, Password)
-> Second Page: Validation (Check Login and Password via MySQL-Database)
-> Third Page: Work with validatet data (login, pw in session-variables)

Read books, and your session-descriptions but nothing worked

On which page, do I have to write session_start(), where to I have to
write session_register("name","password") and how to use this on all
the following pages until session is destroyed.

By the way, I even killed Apache 1.3.27 when I tried to call the
second page with secondpage.php?session_id_very_long_nr
as described in one of this postings

Can anybody help me, so that i don't loose my last hairs :wink:

Thanx in advance
Ewald, modern.Shaman
oldtimer
Forum Contributor
Posts: 204
Joined: Sun Nov 03, 2002 8:21 pm
Location: Washington State

Post by oldtimer »

On the 3rd page is where you initialize the session. however you should have a session_start(); at the top line so when going back to the page your sessions keeps. So one they have logged in then something like

session_register("valid_user");

Then every page after this you have the session_start(); at the top.
Post Reply