Session

 
0
 

I am new in web and PHP

want to learn about session... how they are made on login... and how they are carried to next page...

i know to make database and queries..

Featured Replies in this Discussion

  • You start a session with session_start(). That should probably be one of the first lines, if not the first line, of any of your files in which you want to use the session. Then, after starting the session, you can save values to it or retrieve values from it, using $_SESSION. E.g.: Page 1: ... Page 2: ... Hope that helps a bit ;). If not, have you tried searching Google for tutorials on PHP…
    Post Contains: Code
 
1
 

You start a session with session_start(). That should probably be one of the first lines, if not the first line, of any of your files in which you want to use the session.

Then, after starting the session, you can save values to it or retrieve values from it, using $_SESSION. E.g.:

Page 1:

<?php
session_start();
$_SESSION['test'] = 'hello';

Page 2:

<?php
session_start();
echo '<p>The session value for test is now: ' . $_SESSION['test'] . '</p>';

Hope that helps a bit ;). If not, have you tried searching Google for tutorials on PHP sessions?

 
0
 

Oh.. Thanks a lot respected..... it worked out for me... thanks again..

Question Answered as of 1 Year Ago by minitauros
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: