PHP's session management screws JavaScripts up?
| From: | Jeroen Wesbeek | Date: | Thu, 21 Dec 2000 10:48:56 +0000 |
| Subject: | PHP's session management screws JavaScripts up? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-31399@lists.php.net to get a copy of this message | ||
Hello,
We have several problem with php's (4.0.3.pl1) session management system
which we use quite
intensively. When starting to browse a session site (session autostarts en
trans-id is enabled) php
adds the session id to links (the cookie is not yet present), which should
be quite okay. However
links which contain GET vars of themselves might get screwed up when php
inserts the session id;
that's problem 1.
Another problem is that php also changes the JavaScript which is in the
page. This problem, however,
can be solved by changing the double quotes into single quotes. I think you
will agree this is just a
workaround and generally you would like to use whatever JavaScript you like
in your page and don't
have php changing it.
The third problem is a little bit more bizar, check this JavaScript code:
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
x.src=x.oSrc;
}
PHP turns this into:
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr;
for(i=0;a&&i<a.length&&(x="a[i])&&x.oSrc;i++)"
x.src="x.oSrc;"
}
Take a good look at the double quotes. Quite bizar isn't it?
Any possible solution(s)?
Greetings,
dowebwedo
Jeroen Wesbeek
.programming
St. Jacobsstraat 16
Postbus 448 | 3500 AK Utrecht
The Netherlands
p 030 2348110 | f 030 2348605
[roses are red, violets are blue,
I am schizophrenic and so am I ]