| View previous topic :: View next topic |
| Author |
Message |
AidenJordan
Joined: 14 May 2009 Posts: 2
|
Posted: Thu May 14, 2009 12:11 pm Post subject: How to create session: |
|
|
Hi, This is Aiden
I want to know how I create session in PHP. |
|
| Back to top |
|
 |
|
|
 |
stefenalex112
Joined: 14 May 2009 Posts: 1
|
Posted: Thu May 14, 2009 12:26 pm Post subject: Re: |
|
|
Hi,
First of all you create object of that session at caoonection page like-
ob_start();
session_start();
Then
$_SESSION[desire session name]="Desired value to be stored in Session variable".
Thnx |
|
| Back to top |
|
 |
vikas72
Joined: 21 Dec 2007 Posts: 199
|
Posted: Sat May 16, 2009 9:47 pm Post subject: |
|
|
This is a helpful indicator. However, there are complete session tutorial elsewhere in the net and you should take that up. _________________ http://starredreviews.com |
|
| Back to top |
|
 |
Fardoragh
Joined: 01 Jun 2009 Posts: 8
|
Posted: Mon Jun 01, 2009 3:19 pm Post subject: |
|
|
Hi, All,
Sessions are wonder full feature of php and its inbuilt.
One can just write
Code:
session_start();
and the session will start. Session are stored on server side. HTTP protocol is state less protocol so, we need to use session to keep track which user is doing what.
Unique Session ID is assigned to each user who has logged in to the website and session start is executed.
One this should be keep in mind that the session_start(); should be the first line in the php file.
See Tutorials on Website Development.
You can register a variable in session using following code
Code:
$_SESSION['variable_name']="some value"
For more tutorials on php sessions visit WebWorldGuru.com[/url] |
|
| Back to top |
|
 |
Alyssa
Joined: 13 Jun 2009 Posts: 7
|
Posted: Sat Jun 13, 2009 1:39 pm Post subject: |
|
|
Hello stefenalex112,
I used this code in PHP, I created object to a session.
and next started a session.
after that I created Session name.
but how can I run this code and where Can I put. _________________ http://ezdia.org |
|
| Back to top |
|
 |
Fnand
Joined: 28 Jun 2009 Posts: 36
|
Posted: Fri Jul 03, 2009 12:04 pm Post subject: session |
|
|
hey jordan here is the way you can create a session- just tell me if it worked for you
To create a session in php, we have to give the code as below…
session_start() on the top of the file and if u use this code at the top of the file. and then it will create a session in php. |
|
| Back to top |
|
 |
jitendra45
Joined: 04 Jul 2009 Posts: 26
|
Posted: Sat Jul 04, 2009 10:10 am Post subject: start session |
|
|
hi jordan here is how to do it,
session_start() creates a session or resumes the current one based on the current session id that's being passed via a request, such as GET, POST, or a cookie.
If you want to use a named session, you must call session_name() before calling session_start().
session_start() will register internal output handler for URL rewriting when trans-sid is enabled. If a user uses ob_gzhandler or like with ob_start(), the order of output handler is important for proper output. For example, user must register ob_gzhandler before session start. |
|
| Back to top |
|
 |
|