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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul

    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:

    and the code included below can be tested here:


    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="JavaS cript" type="text/javascript">
    <!--
    function BoardClick(){
    document.GetMov eForm.elements[0].value = 'click';
    }
    // -->
    </SCRIPT>
    </HEAD>
    <BODY vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff >
    <IMG src="DruidBack1 x6.png" onClick='BoardC lick()'>
    <FORM name=GetMoveFor m action=Druid.ph p method=get>
    Click or enter move <INPUT maxLength=30 size=10 name=1>
    <INPUT type=submit value="View move"></FORM>
    </BODY>
    </HTML>
  • Alvaro G. Vicario

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

    *** Paul escribió/wrote (4 Sep 2004 14:19:25 -0700):[color=blue]
    > http://www.math.lsu.edu/~wamelen/gam...uid/druid5.php[/color]

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

    <input type="hidden" name="PHPSESSID "
    value="7eae9af6 2e97fe895738a1b cf7dd300e" />

    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.ta gs a=href,area=hre f,frame=src,inp ut=src,form=fak eentry

    url_rewriter.ta gs string

    url_rewriter.ta gs specifies which HTML tags are rewritten to include
    session id if transparent sid support is enabled. Defaults to
    a=href,area=hre f,frame=src,inp ut=src,form=fak eentry,fieldset =




    --
    --
    -+ Á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»
    --

    Comment

    • Paul

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

      "Alvaro G. Vicario" <kAlvaroNOSPAMT HANKS@terra.es> wrote in message news:<1fnwbg4es xw0g$.145xglkth 84cy$.dlg@40tud e.net>...[color=blue]
      > *** Paul escribió/wrote (4 Sep 2004 14:19:25 -0700):[color=green]
      > > http://www.math.lsu.edu/~wamelen/gam...uid/druid5.php[/color]
      >
      > Check the source code. The first time the page is loaded, there's a hidden
      > form field:
      >
      > <input type="hidden" name="PHPSESSID "
      > value="7eae9af6 2e97fe895738a1b cf7dd300e" />
      >
      > 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.[/color]

      Thank you so much Alvaro, that solved the problem!

      Best,
      Paul

      Comment

      Working...