Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How can we know that a session is started or not?

Answers were Sorted based on User's Feedback



How can we know that a session is started or not?..

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

How can we know that a session is started or not?..

Answer / rahul

on head of the page we have to write
session_start();
statement.

Is This Answer Correct ?    3 Yes 9 No

How can we know that a session is started or not?..

Answer / kamlesh

we can check is_session_start() by this function.

Is This Answer Correct ?    3 Yes 9 No

Post New Answer

More PHP Interview Questions

Tell me how to create a session? How to set a value in session? How to remove data from a session?

0 Answers  


Write a program to display a table of any given number?

0 Answers  


Do you know what are traits?

0 Answers  


What is meant by session in php?

0 Answers  


How to calculate the difference between two dates using php?

0 Answers  


What is data structure in php?

0 Answers  


List functions available to sort an php array?

0 Answers  


Tell me how can we pass the variable through the navigation between the pages?

0 Answers  


how to work lamp server

0 Answers  


How can we know the number of days between two given dates using PHP? How can we know the number of days between two given dates using MySQL?

6 Answers  


What does $_env mean?

0 Answers  


What is member variable?

0 Answers  


Categories