By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,857 Members | 1,793 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,857 IT Pros & Developers. It's quick & easy.

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

P: n/a
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:
http://www.math.lsu.edu/~wamelen/gamerz/info.php
and the code included below can be tested here:
http://www.math.lsu.edu/~wamelen/gam...uid/druid5.php

Sincerely,
Paul van Wamelen

<?php
session_start();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript" type="text/javascript">
<!--
function BoardClick(){
document.GetMoveForm.elements[0].value = 'click';
}
// -->
</SCRIPT>
</HEAD>
<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>
</BODY>
</HTML>
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
*** Paul escribió/wrote (4 Sep 2004 14:19:25 -0700):
http://www.math.lsu.edu/~wamelen/gam...uid/druid5.php


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=fakeentr y

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
a=href,area=href,frame=src,input=src,form=fakeentr y,fieldset=
http://es2.php.net/session

--
--
-+ Álvaro G. Vicario - Burgos, Spain - ICQ 46788716
+- http://www.demogracia.com (la web de humor para mayores de 100 años)
++ «Sonríe, que te vamos a hacer una foto para la esquela»
--
Jul 17 '05 #2

P: n/a
"Alvaro G. Vicario" <kA*****************@terra.es> wrote in message news:<1f*******************************@40tude.net >...
*** Paul escribió/wrote (4 Sep 2004 14:19:25 -0700):
http://www.math.lsu.edu/~wamelen/gam...uid/druid5.php


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.


Thank you so much Alvaro, that solved the problem!

Best,
Paul
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.