session_start() and JavaScript in IE6 problem, please help!

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Dear experts,

I have a problem with session_start() and JavaScript. In IE6 (but not
Mozilla) the first time the page below loads the JavaScript doesn't
work (clicking on the graphic should write 'click' in the form entry
box). After you hit refresh it works fine. IE doesn't report any error
(reporting is turned on). It also works fine if I remove the
"session_start()".  Is this an IE bug or am I doing something wrong?
Is there a fix or a work-around? Any help would be greatly
appreciated. I'm using PHP Version 4.3.8 on an Apache server (the full
"info()" can be seen here:
and the code included below can be tested here:

Paul van Wamelen

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   " ">
<SCRIPT LANGUAGE="JavaScript" type="text/javascript">
function BoardClick(){
  document.GetMoveForm.elements[0].value = 'click';
// -->
<BODY vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff>
<IMG src="DruidBack1x6.png" onClick='BoardClick()'>
<FORM name=GetMoveForm action=Druid.php method=get>
Click or enter move <INPUT maxLength=30 size=10 name=1>
<INPUT type=submit value="View move"></FORM>

Re: session_start() and JavaScript in IE6 problem, please help!

*** Paul escribi/wrote (4 Sep 2004 14:19:25 -0700):
Quoted text here. Click to load it

Check the source code. The first time the page is loaded, there's a hidden
form field:

<input type="hidden" name="PHPSESSID"
value="7eae9af62e97fe895738a1bcf7dd300e" />

Your JavaScript code doesn't get objects through name but through position,
thus failing when element 0 is not your text field but the hidden one.

This is a PHP workaround for transmitting session ID when cookies are
disabled. Once it checks cookies do work (the second time it's loaded) the
workaround is no longer needed:

url_rewriter.tags a=href,area=href,frame=src,input=src,form=fakeentry    

url_rewriter.tags  string

    url_rewriter.tags specifies which HTML tags are rewritten to include
session id if transparent sid support is enabled. Defaults to

-+ lvaro G. Vicario - Burgos, Spain - ICQ 46788716
+- (la web de humor para mayores de 100 aos)
++ Sonre, que te vamos a hacer una foto para la esquela

Re: session_start() and JavaScript in IE6 problem, please help!

Quoted text here. Click to load it

Thank you so much Alvaro, that solved the problem!


Site Timeline