JavaScript includes and php variables replacement
Posted: Thu Aug 01, 2002 9:37 am
Dear folks,
I have built a JavaScript-based DHTML drop-down menu (using the DHTML Menu Builder tool) and I have included the generated menu.js file at the beginning of each php page.
Now I would like to use the php session variables feature to share php variables across different pages. In order to do that, I need to append a ?<?=SID?> string at the end of each local link.
I changed the local URLs associated to each menu command accordingly, and generated a new version of menu.js.
However, when a web page is processed by php, the JavaScript menu.js include is not processed and therefore the SID constant is not replaced with its corresponding session id value.
Variables replacement works fine if JavaScript code is entered inline within the page (no include); however the menu.js file is very long and does not work properly when physically copied into each page.
Can you help me? Thanks.
I have built a JavaScript-based DHTML drop-down menu (using the DHTML Menu Builder tool) and I have included the generated menu.js file at the beginning of each php page.
Now I would like to use the php session variables feature to share php variables across different pages. In order to do that, I need to append a ?<?=SID?> string at the end of each local link.
I changed the local URLs associated to each menu command accordingly, and generated a new version of menu.js.
However, when a web page is processed by php, the JavaScript menu.js include is not processed and therefore the SID constant is not replaced with its corresponding session id value.
Variables replacement works fine if JavaScript code is entered inline within the page (no include); however the menu.js file is very long and does not work properly when physically copied into each page.
Can you help me? Thanks.