Need some help with PHP/MySQL

Wabsta

you fight like a dairy farmer
OP
Member
Joined
Apr 25, 2008
Messages
2,495
Trophies
0
Age
32
Location
SCUMM Bar
Website
www.wabsta.com
XP
449
Country
Netherlands
Okay, I managed to make a login, and a register script (it's for a school project btw).
But, it has to check if someone really logged in.

I've read something about sessions, but I didn't really get it.

So, can someone explain these Sessions to me?
 

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
46
Location
Engine room, learning
XP
15,662
Country
France
session is like temporary informations on the userside, which are deleted when the user close its explorer or tab window.


to read those data, you need to initialize (allow PHP to access) the sessions on each page you need it with a session_start()

CODE
 

Wabsta

you fight like a dairy farmer
OP
Member
Joined
Apr 25, 2008
Messages
2,495
Trophies
0
Age
32
Location
SCUMM Bar
Website
www.wabsta.com
XP
449
Country
Netherlands
Wow, thanks, that was better than all those tutorials on the interwebs.

Because I finally get it now.
So, thanks, I'll try it tommorow morning in class
smile.gif
 

Wabsta

you fight like a dairy farmer
OP
Member
Joined
Apr 25, 2008
Messages
2,495
Trophies
0
Age
32
Location
SCUMM Bar
Website
www.wabsta.com
XP
449
Country
Netherlands
Okay, I have this code now, but it doesn't work.
It's based on your idea Cyan.
Here it is:
CODE

It kinda works, as it makes me go to the site I inteded to go to (home.php, in home.php, there was a require "auth.php" which is this file), but if I go there again, it just gives me the login section again...
So probably, the session doesn't work.

Some information:
naam=name
wachtwoord=pass
verzonden=submit

These are some dutch words, that you may not figure out what it is
wink.gif


EDIT: I think it works now:
CODE

But how do I logout now?
I don't really get it..

EDIT 2:
NVM, figured it out.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Xdqwerty @ Xdqwerty: See ya see ya later later