php - How to get a session variable work in java script function? -
it may stupid question, went through various pages since 2 days, , didn't solution myself. made session variable this:
<?php session_start(); $_session['currentpage']="home"; ?> (i checked, make variable , assign right.)
then tried use parameter here:
<body onload="changepage($_session['currentpage'])">
it doesn't pass variable. tried put directly function, not parameter, inside it, doesn't work either. missing here bet. can please out? thanks.
you missing php tags:
<body onload="changepage('<?php echo $_session['currentpage']; ?>')">
Comments
Post a Comment