473,382 Members | 1,717 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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

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
2 3194
*** 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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Florence HENRY | last post by:
Hello, I've searched about my problem on google before posting, but I didn't find anything relevant... I have a problem with session_start. Here is my code : <html> <head> <?php...
4
by: K. Choi | last post by:
I had installed php 4.3.7 on my system and test some php code. But there is a serious problem. On my system(using apache2) the code, <?php session_start(); ?> gets some warning, Warning:...
5
by: cowofchaos | last post by:
when I use the session_start() function at the top of my scripts I get 5 errors on the page If anyone can help please do this has been a problem for a while and I cannot do much more work on my...
3
by: Trogdor | last post by:
I set up a server on an AMD 650 machine running gentoo linux. I installed Apachie 2, MySQL 4.1 and PHP 4.3.11 I use another computer on my local net (192.168.0.x) to access the server as a...
5
by: Niklas Uhlin | last post by:
Someone please explain why Session_Start fires multiple times / retains SessionID values between sessions, when you open an ASP.NET page from MS Word. For details of the problem, see below: 1....
4
by: Vincent | last post by:
Hello, Does anyone have a problem with Apache2 crashing after executing a PHP script with session_start()? I notice if session_start() is placed anywhere except at the start of the file, APache...
19
by: lawrence k | last post by:
How can I find out where my script is outputting to the screen for the first time? My error logs are full of stuff like this: PHP Warning: session_start(): Cannot send session cache...
4
by: three-eight-hotel | last post by:
I'm somewhat of a newbie to PHP coding, but have developed a site using the technology, and have been pleasantly surprised by the capabilities offered. I am more comfortable in the ASP world,...
5
by: siyaverma | last post by:
Hi, I am new to php, i was doing some small chnages in a project developed by my collegue who left the job and i got the responsibility for that, After doing some changes when i run it on my...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.