Skip to content
Advertisement

How to load users name from session ID, PHP

How do I load a user’s name from his session ID?

So it should work like this: User goes on the website for the first time (gets his session id) enters his name and from now on gets redirected to the website that shows his name.

I have worked out the redirecting stuff with the following code:

JavaScript

Advertisement

Answer

Create a $_SESSION that has the name in it with a POST or GET

HTML

JavaScript

PHP

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement