get a session variable using java script function?

Total Post:104

 1472  View(s)
Rate this:

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:



(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.

  1. Post:110

    Re: get a session variable using java script function?

    You are missing the PHP tags:

    <a onclick="'../../Process.aspx','cal','width=490,height=420,left=500,top=180,scrollbars=no')"

    href="javascript:;"><img alt="Process" src="../../images/register.gif" style="border-top-style: none; border-right-style: none; border-left-style: none; border-bottom-style: none" id="IMG1" onclick="return IMG1_onclick()" /></a>

    <script type="text/javascript" src="../../NoPostBacks.js">

    function IMG1_onclick() {

    Session("Amount") = Me.txtAmount.Text

    Session("Zip") =Me.txtZip.Text


    </script> - See more at:

    <body onload="changepage('<?php echo $_SESSION['currentpage']; ?>')">

      Modified On Apr-06-2018 02:18:04 AM