php - How to format a session variable in a bracket part -


i use tablesorter. in page before set session cookie.

tablesorter has part:

   $.tablesorter.setfilters( table, ['', 'test'  ], true); 

now need session variable word 'test' is, don't know how format it...

is this:

  $.tablesorter.setfilters( table, ['', ($_session["favcoloor"]) ], true); 

or this:

 $.tablesorter.setfilters( table, ['', '($_session["favcoloor"])' ], true); 

or this:

  $.tablesorter.setfilters( table, ['', $_session["favcoloor"] ], true); 

or

  $.tablesorter.setfilters( table, ['', "$_session["favcoloor"]" ], true); 

i can not work, please me correct formatting.

you need echo session variable php jquery code :)

$.tablesorter.setfilters( table, ['', '<?php echo $_session["favcoloor"]; ?>' ], true); 

if php shorthand tags enabled, can use this:

$.tablesorter.setfilters( table, ['', '<?=$_session["favcoloor"];?>' ], true); 

Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -