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?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to delete an element from an array?

1151


How to select a database?

1065


What is difference between python and php?

1029


how retrive the video file in php using video tag

1828


Is empty in excel?

1041


What is the static variable in function useful for?

1025


What is the correct php command to use to catch any error messages within the code?

1121


What are the steps involved to run php?

1120


How to calculate the difference between two dates using php?

1106


What is the difference between myisam and innodb?

1103


Why use php artisan serve?

1020


How to split a string into array using php?

1261


How can you upload a file using php?

1162


What is the name of the scripting engine that powers PHP?

1286


What is basic php?

1122