php reference in <SCRIPT> tag gives "Error on page" in IE6.0

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

    php reference in <SCRIPT> tag gives "Error on page" in IE6.0

    Hi,

    I have some problems with a PHP reference in a <SCRIPTtag, but only
    with the Internet Explorer, which gives a "Error on page" message in
    the Status Bar.
    The code is as follows :
    <script>
    <!--
    var stat =<?php echo stripslashes($s tatus); ?>;
    window.status = stat;
    //-->
    </script>

    The error given is :

    Line:24
    Char:13
    Error: Syntax error
    Code: 0

    Char 13 is the "<" or looking to the source of the page with the IE
    browser, it's ";"

    I get the error message as said before only in the Internet Explorer
    browser and it does not affect the display nor the functionality of
    the page, but it's not good looking ...

    Has anyone out there a solution to get rid of the "error" ?

    Thanks in advance.

  • Captain Paralytic

    #2
    Re: php reference in &lt;SCRIPT&g t; tag gives &quot;Error on page&quot; in IE6.0

    On 8 Feb, 13:27, "rukkie" <ruk...@belgaco m.netwrote:
    Hi,
    >
    I have some problems with a PHP reference in a <SCRIPTtag, but only
    with the Internet Explorer, which gives a "Error on page" message in
    the Status Bar.
    The code is as follows :
    <script>
    <!--
    var stat =<?php echo stripslashes($s tatus); ?>;
    window.status = stat;
    //-->
    </script>
    >
    The error given is :
    >
    Line:24
    Char:13
    Error: Syntax error
    Code: 0
    >
    Char 13 is the "<" or looking to the source of the page with the IE
    browser, it's ";"
    >
    I get the error message as said before only in the Internet Explorer
    browser and it does not affect the display nor the functionality of
    the page, but it's not good looking ...
    >
    Has anyone out there a solution to get rid of the "error" ?
    >
    Thanks in advance.
    Justa guess, but try surrounding the php call with quotes.

    Comment

    • Captain Paralytic

      #3
      Re: php reference in &lt;SCRIPT&g t; tag gives &quot;Error on page&quot; in IE6.0

      On 8 Feb, 13:27, "rukkie" <ruk...@belgaco m.netwrote:
      Hi,
      >
      I have some problems with a PHP reference in a <SCRIPTtag, but only
      with the Internet Explorer, which gives a "Error on page" message in
      the Status Bar.
      The code is as follows :
      <script>
      <!--
      var stat =<?php echo stripslashes($s tatus); ?>;
      window.status = stat;
      //-->
      </script>
      >
      The error given is :
      >
      Line:24
      Char:13
      Error: Syntax error
      Code: 0
      >
      Char 13 is the "<" or looking to the source of the page with the IE
      browser, it's ";"
      >
      I get the error message as said before only in the Internet Explorer
      browser and it does not affect the display nor the functionality of
      the page, but it's not good looking ...
      >
      Has anyone out there a solution to get rid of the "error" ?
      >
      Thanks in advance.
      Just re-read your post. The php script isn't outputting anything,
      that's why it ends up with the = followed by the ; which is certainly
      incorrect syntax.

      Comment

      • Jerry Stuckle

        #4
        Re: php reference in &lt;SCRIPT&g t; tag gives &quot;Error on page&quot; in IE6.0

        rukkie wrote:
        Hi,
        >
        I have some problems with a PHP reference in a <SCRIPTtag, but only
        with the Internet Explorer, which gives a "Error on page" message in
        the Status Bar.
        The code is as follows :
        <script>
        <!--
        var stat =<?php echo stripslashes($s tatus); ?>;
        window.status = stat;
        //-->
        </script>
        >
        The error given is :
        >
        Line:24
        Char:13
        Error: Syntax error
        Code: 0
        >
        Char 13 is the "<" or looking to the source of the page with the IE
        browser, it's ";"
        >
        I get the error message as said before only in the Internet Explorer
        browser and it does not affect the display nor the functionality of
        the page, but it's not good looking ...
        >
        Has anyone out there a solution to get rid of the "error" ?
        >
        Thanks in advance.
        >
        You shouldn't even see the php code in your script. It should have been
        executed by the server. Is this what the actual source code in your
        page looks like?

        Is the rest of your PHP code on that page being parsed and executed?

        Also, what happens if you get rid of the <!-- ... --delimiters - which
        were only required for browsers which came out 15 years ago?

        --
        =============== ===
        Remove the "x" from my email address
        Jerry Stuckle
        JDS Computer Training Corp.
        jstucklex@attgl obal.net
        =============== ===

        Comment

        • rukkie

          #5
          Re: php reference in &lt;SCRIPT&g t; tag gives &quot;Error on page&quot; in IE6.0

          Thank you so much ...
          The page only receives a status if the page was called from another
          page ...
          Initially the page has not received any status ...I did not toke into
          account this situation ...
          So I have to implement something so that there is always some kind of
          status available, no matter from where the page was called ....

          Thanks !!


          Comment

          Working...