Critical problems with Javascript and session_start |
Site Admin
|
It would be very helpful for our engineers to get code samples that will replicate the problems you faced.
|
||||||||||||
_________________ The PHP IDE team |
|
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']; ?> |
||||||||||||||
|
Site Admin
|
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 |
Critical problems with Javascript and session_start |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by