How can we know that a session is started or not?
Answers were Sorted based on User's Feedback
Answer / deep
we'll have to set a session variable after starting a
session as shown below
--------------------------------------------------
<?php
session_start();
if(isset($_SESSION['views']))
$_SESSION['views']=$_SESSION['views']+1;
else
$_SESSION['views']=1;
echo "Views=". $_SESSION['views'];
?>
--------------------------------------------------
it will set as well as increment the session variable
or we may simply echo a value to check whether a session is
started or not.
Is This Answer Correct ? | 10 Yes | 0 No |
Answer / rahul
on head of the page we have to write
session_start();
statement.
Is This Answer Correct ? | 3 Yes | 9 No |
Answer / kamlesh
we can check is_session_start() by this function.
Is This Answer Correct ? | 3 Yes | 9 No |
Write a program to find the factorial of a number in php?
What does $_env means?
what is the diffrence between for and foreach?
11 Answers Hirolasoft, IBM, Photon,
How to get number of elements in an array?
How do I run php?
display selected value in dropdown list through javascript without page refresh
List out some tools through which we can draw E-R diagrams for mysql?
Which method removes the last element from the end of an array?
A company named Pensar Technologies in chennai has offered me a job as Software Trainee in chennai.But they are asking to pay demand draft of Rs.75000/- in the name of the company.They are saying the gross renumeration will pay Rs.90000/- annually.I want to know whether this is good or bad company?Help me out in this.
Does not want to see PHPSESSID in the url. How can be done this ?
Tell me how is it possible to parse a configuration file?
How to find current date and time?