RE: [PHP] SESSIONS in javascript

From: Date: Wed, 10 Apr 2002 21:45:16 +0000
Subject: RE: [PHP] SESSIONS in javascript
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-92460@lists.php.net to get a copy of this message
might be a solution: don't use a javascript includepage, instead use the "inline code" method in a php.includefile, something like this include "javascript.inc"; where the javascript.inc (js.inc, js.php, javascript.php - your name, your choice) contains <script language="javascript"> <!-- hide code // javascript code and functions function exampleFuncWithPHPSess() { var=<?$Session["thingie"];?>; } //-- end hiding --> </script> the code would then appear "inline" in the php-file put out by the server (to the client), but you could still have it in a separate file.. and you get to use php sessions. Note: I'm new myself to php, so this might be a no-go, but i've done it with asp, and it's worked in the past.. /morpheo --- --- --- --- --- --- --- --- --- --- --- --- --- --- Alfonso Orion X Allende | alfonso@allende.nu Interface Developer | Kasuar Form & Funktion http://www.allende.nu/ --- --- --- --- --- --- --- --- --- --- --- --- --- --- -----Original Message----- From: Morten Nielsen [mailto:mosgaard2000@hotmail.com] Sent: den 10 april 2002 22:31 To: php-general@lists.php.net Subject: [PHP] SESSIONS in javascript Hi, I got a PHP page where I define a SESSION. I then include a javascript page where I would like to use the value which is stored in the SESSION. The problem is that the php tags <? ?> doesn't work in javascript. Can anyone tell me how to do that? Regards, Morten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#92460) next »