condition to check if the session variables as well as get and post have been destroyed in php -
the code like:(it last page of web-app have made)
<?php if(isset($_get['var']) { session_start(); $a=$_session['prev_defined']; #more use of session variable session_destroy(); $_session = array(); unset($_get); unset($_post); } ?>
now when execute web application runs fine , when refresh last page code given above warning message shows of undefined symbol because $_session
variables $_get
, $_post
have been deleted. want display message "session over" on refresh. how it? put if condition? have tried put above code in
if($_session) { #entire code above } else { echo"session over"; }
but displayes message undefined variable _session
<?php if(isset($_get['var']) { if(isset($_session)) { session_start(); $a=$_session['prev_defined']; #more use of session variable session_destroy(); $_session = array(); unset($_get); unset($_post); } else { echo"session over"; } } ?>
try one. if session set conditions.
edit
if(isset($_get['var']) { .... } else { echo"session over"; }
using this, if $_get['var']
not set echo else part
edit 2
<?php if (isset($_get) || isset($_session)) { //put codes here } else { echo "session over"; }
Comments
Post a Comment