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

What is different between software and app

1689


Explain mail function in PHP with syntax?

949


How can we submit from without a submit button?

963


Where is session value stored?

937


Why php is also called as scripting language?

912


How many columns can be added in a table in mysql?

929


How many types of array supported in php?

922


Explain what is the main difference between require() and require_once()?

935


What are psrs? Choose 1 and briefly describe it?

1373


How send email using php?

913


Explain me what is the use of 'print' in php?

872


Why php is widely used?

902


What types of Data Can Be Used as Array Keys?

977


Which function can be used to exit from the script after displaying the error message?

893


Is age interval or ordinal?

889