php - Checking isset on session stops javascript -



php - Checking isset on session stops javascript -

hey checking if existence of $_session variable javascript..

if (<?php echo isset($_session["variable"]); ?>){ //alert ("lol"); }

if exists works fine, otherwise gives java script error. illustration

alert("<?php echo isset($_session["variable"]); ?>");

gives empty alert, doesn't give errors

what missing?

echo won't output false getting if() syntax error. utilize var_export(isset($_session['variable'])) instead, either output true or false

javascript php session

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -