forum

home / developersection / forums / get a session variable using java script function?

get a session variable using java script function?

marcel ethan 2439 01-Nov-2014

It may look like a stupid question, but I went through various pages since 2 days, and didn't get to a solution by myself. So I made a session variable like this:

<?php
session_start();

$_SESSION['currentpage']="home";
?>

(I checked, it does make the variable and assign it right.)

Then I tried to use it as a parameter here:

<body onload="changepage($_SESSION['currentpage'])">

It doesn't pass the variable. I tried to put it into  directly the function, like not as a parameter, but inside it, doesn't work.


Updated on 01-Nov-2014
Can you answer this question?

Answer

1 Answers

Liked By