By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,614 Members | 1,662 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,614 IT Pros & Developers. It's quick & easy.

session in php

P: 1
why do i get an error when so ever i use a seesion in php coding???/why do session is not set.
Sep 4 '08 #1
Share this Question
Share on Google+
6 Replies


10K+
P: 13,264
Post the code you used. Hopefully you were referring to a manual when you wrote the code.
Sep 4 '08 #2

Markus
Expert 5K+
P: 6,050
Also post the error message you receive.
Sep 4 '08 #3

100+
P: 190
Check whether u start the session (session.start)
Sep 5 '08 #4

Markus
Expert 5K+
P: 6,050
Check whether u start the session (session.start)
You mean session_start().
Sep 5 '08 #5

100+
P: 190
yes you said right..If not include session_start() then not set on that page..
Sep 5 '08 #6

P: 24
this is what u need to do.

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. session_start(); //Make sure this is right at the top
  3. $_SESSION['example']="Example"; // Now you can use this variable, or if you have set it from before then you dont have to do this.
  4. $example=$_SESSION['example'];
  5. echo $example;
  6. ?>
  7.  
Ill be happy to help you if you need more help.
Sep 5 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.