NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Critical problems with Javascript and session_start


Joined: 30 Jan 2007
Posts: 2
Reply with quote
Hello,

I try to develope a program using Php Dock and i get the following problems:

1. I have a javascript code that converts enter to tab keys. It's working on all internet explorer version but not on Php Dock.
http://mywebserver/forms/tab-key-emulation.html
2. The session lost when I open a new window. I used session_start() for the new window and session.auto_start=1
in php.ini.

Thank you,
View user's profileFind all posts by vipSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
It would be very helpful for our engineers to get code samples that will replicate the problems you faced.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 30 Jan 2007
Posts: 2
Reply with quote
dmitri wrote:
It would be very helpful for our engineers to get code samples that will replicate the problems you faced.


1.

File name: sample1.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Example 1</title>
<SCRIPT LANGUAGE="JavaScript">
nextfield = "box1"; // name of first box on page
netscape = "";
ver = navigator.appVersion; len = ver.length;
for(iln = 0; iln < len; iln++) if (ver.charAt(iln) == "(") break;
netscape = (ver.charAt(iln+1).toUpperCase() != "C");

function keyDown(DnEvents) { // handles keypress
// determines whether Netscape or Internet Explorer
k = (netscape) ? DnEvents.which : window.event.keyCode;
if (k == 13) { // enter key pressed
if (nextfield == 'done') return true; // submit, we finished all fields
else { // we're not done yet, send focus to next box
eval('document.yourform.' + nextfield + '.focus()');
return false;
}
}
}
document.onkeydown = keyDown; // work together to analyze keystrokes
if (netscape) document.captureEvents(Event.KEYDOWN|Event.KEYUP);
// End -->
</script>
</head>

<body>
<form name=yourform>
Box 1: <input type=text name=box1 onFocus="nextfield ='box2';"><br>
Box 2: <input type=text name=box2 onFocus="nextfield ='box3';"><br>
Box 3: <input type=text name=box3 onFocus="nextfield ='box4';"><br>
Box 4: <input type=text name=box4 onFocus="nextfield ='done';"><br>
<input type=submit name=done value="Submit">
</form>

</body>
</html>

----------------------------------------------------------------------------------------
2.
File1: sample2_start.php

<?
session_start();
$_SESSION['test'] = "test";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script language="JavaScript" type="text/javascript">
function doAction(){
window.open('sample2_session.php','mywindow','width=1,height=1,status=no,menubar=no,scrollbars=no,resizable=no');
}
</script>
</head>

<body>
<a href="sample2_session.php">Self - It's workink</a>
<br />
<a href="#" onclick="doAction();" >New Window (It's not Workink)</a></br>
</body>
</html>


File2: sample2_session.php


<?
session_start();
echo $_SESSION['test'];
?>
View user's profileFind all posts by vipSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
with 1st issue, we'll contact you by email.
with 2nd, it's an expected behaviour if you use temporary cookies for passing session ID.
Indeed, when you open "New Window" from PhpDock, it runs new instance of Internet Explorer and this instance has no way to know any temporary cookies established in PhpDock.
When you open New Window in Ineternet Explorer, it does not run new instance at all (you'll see only one IE process in the process list).

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Critical problems with Javascript and session_start
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic