Problem with "escaped characters" not all double quotes show up?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • madsgormlarsen@gmail.com

    Problem with "escaped characters" not all double quotes show up?

    $tdsubclass=<<< bumelum
    <td><a href="http://www.ygabel.php/$artnr[$arayartnrcount er]"
    ="" onmouseout="
    function onmouseout(even t) {
    window.status = "Done";
    return true;
    }
    " onmouseover="
    function onmouseover(eve nt) {
    window.status = "http://www.fup.dk";
    return true;
    }
    "> <!--target="_Self"-->
    bumelum;

    When I print this the double quotes after Done" and after dk" are
    missing???

    I have also tried with escaped characters in double quotes

    Any suggestions?

  • madsgormlarsen@gmail.com

    #2
    Re: Problem with &quot;escape d characters&quot ; not all double quotes show up?

    I have also treid

    $tdsubclass="
    <td><a
    href=\"http://d1995732.u48.su rftown.dk/andersen/bygtabel.php/".$artnr[$arayartnrcount er]."\"
    =\"\" onmouseout=\"
    function onmouseout(even t) {
    window.status = \"Done\";
    return true;
    }
    \" onmouseover=\"
    function onmouseover(eve nt) {
    window.status = \"http://www.watski.dk/andersensk\xF8d espil\";
    return true;
    }
    \"> <!--target=\"_Self\ "-->
    ";

    same result

    Comment

    • Ken Robinson

      #3
      Re: Problem with &quot;escape d characters&quot ; not all double quotes show up?



      madsgormlarsen@ gmail.com wrote:[color=blue]
      > $tdsubclass=<<< bumelum
      > <td><a href="http://www.ygabel.php/$artnr[$arayartnrcount er]"
      > ="" onmouseout="
      > function onmouseout(even t) {
      > window.status = "Done";
      > return true;
      > }
      > " onmouseover="
      > function onmouseover(eve nt) {
      > window.status = "http://www.fup.dk";
      > return true;
      > }
      > "> <!--target="_Self"-->
      > bumelum;
      >
      > When I print this the double quotes after Done" and after dk" are
      > missing???[/color]

      Think about how you're quoting.

      You have onmouseout <double quote to start string>. The double quote
      before the word Done closes that quote. I'm surprised you didn't get
      any errors with this construct. Does it work if you write a test HTML
      page?

      Here's a test script that I wrote that seems to fix you're problem:

      <?
      $artnr = array('testing1 23');
      $arayartnrcount er = 0;

      $tdsubclass="
      <td><a
      href=\"http://www.ygabel.php/$artnr[$arayartnrcount er]\"
      =\"\" onmouseout=\"
      function onmouseout(even t) {
      window.status = 'Done';
      return true;
      }

      \" onmouseover=\"
      function onmouseover(eve nt) {
      window.status = 'http://www.fup.dk';
      return true;
      }

      \"> <!--target=\"_Self\ "-->
      ";
      echo '<pre>'.htmlent ities($tdsubcla ss,ENT_QUOTES). '</pre>';

      ?>

      I got rid of the heredoc syntax and just made it into a string with
      escaped double quotes and some single quotes.

      Ken

      Comment

      • madsgormlarsen@gmail.com

        #4
        Re: Problem with &quot;escape d characters&quot ; not all double quotes show up?

        Many thanks for the suggestion, but jave apperently need the double
        qutes to work. I don't understand why it takes the double qute on start
        of mouse out as start of string, they are all escaped.

        Mads

        Comment

        • Jerry Stuckle

          #5
          Re: Problem with &quot;escape d characters&quot ; not all double quotes showup?

          madsgormlarsen@ gmail.com wrote:[color=blue]
          > Many thanks for the suggestion, but jave apperently need the double
          > qutes to work. I don't understand why it takes the double qute on start
          > of mouse out as start of string, they are all escaped.
          >
          > Mads
          >[/color]

          Mads,

          Did you try Ken's suggestion? It's correct and it works.

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

          Comment

          • madsgormlarsen@gmail.com

            #6
            Re: Problem with &quot;escape d characters&quot ; not all double quotes show up?

            Hi

            Ok, what I need for the java to do is to hide the real link, when I
            treid the suggestion of Ken it just showed the real link. Why that is I
            do not know.

            However I got it to work with this code, and I am now facing a new
            problem, how to make it xhtml 1.0 validate. - all suggestions are
            welcome.

            But if anybody had anymore insight as to why it did not work, and why
            Kens does, I am very interrested because I woul like to understand what
            I did wrong.

            $tdsubclass="<t d class=\"sup\">< a
            href=\"http://bygtabel.php/$artnr[$arayartnrcount er]\"


            onMouseOver=\"w indow.status =
            'http://www.fup.dk/$artnr[$arayartnrcount er]';
            return true;\"
            onMouseOut=\"wi ndow.status =\"; return
            true;\"><!--target=\"_Self\ "-->";

            Comment

            • Jerry Stuckle

              #7
              Re: Problem with &quot;escape d characters&quot ; not all double quotes showup?

              madsgormlarsen@ gmail.com wrote:[color=blue]
              > Hi
              >
              > Ok, what I need for the java to do is to hide the real link, when I
              > treid the suggestion of Ken it just showed the real link. Why that is I
              > do not know.
              >[/color]

              First of all, this isn't java - it's PHP.

              I saw nothing earlier about you wanting to hide a link. Why hide it? It just
              makes things more difficult for your users.

              As to making XML validate - try one of the XML newsgroups.
              [color=blue]
              > However I got it to work with this code, and I am now facing a new
              > problem, how to make it xhtml 1.0 validate. - all suggestions are
              > welcome.
              >
              > But if anybody had anymore insight as to why it did not work, and why
              > Kens does, I am very interrested because I woul like to understand what
              > I did wrong.
              >
              > $tdsubclass="<t d class=\"sup\">< a
              > href=\"http://bygtabel.php/$artnr[$arayartnrcount er]\"
              >
              >
              > onMouseOver=\"w indow.status =
              > 'http://www.fup.dk/$artnr[$arayartnrcount er]';
              > return true;\"
              > onMouseOut=\"wi ndow.status =\"; return
              > true;\"><!--target=\"_Self\ "-->";
              >[/color]

              Remember - PHP is server side. Javascript is client side. Two entirely different
              things. For instance - javascript knows about DOM - because DOM is interpreted
              by the browser, and javascript runs on the browser. The server doesn't know (or
              care) about DOM, and neither does PHP.

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

              Comment

              • madsgormlarsen@gmail.com

                #8
                Re: Problem with &quot;escape d characters&quot ; not all double quotes show up?

                >>Why hide it?

                The situation is this, my client has a CMS system that runs i asp, and
                it uses frames. I am going to make a page that is going to run in a
                frame on that page, but in PHP runing on a different server. - in order
                to make the links short an meaningful for the user I am going to make
                them myself. So instead of b7797977.com/lakj/kasdjfja/123.php it is
                going to say product/123.php forexsampel.
                [color=blue][color=green]
                >>First of all, this isn't java - it's PHP.[/color][/color]

                I figured the problem here is with PHP and not javascript, because the
                problem is to get PHP to echo the java code. Because the java code
                works just fine, but I could not get PHP to echo it with the double
                quetes I need.

                What does DOM stand for?

                Thanks to both of you for taking time to answer my questions. And I
                would still really like if somebody could sheed some light on what is
                wrong with the escaped charaters in my own try.

                Ken writes[color=blue][color=green]
                >>You have onmouseout <double quote to start string>. The double quote[/color][/color]
                before the word Done closes that quote.

                and there absolutly is a problem, but the double quotes are escaped, so
                I just dont get it.

                Comment

                • madsgormlarsen@gmail.com

                  #9
                  Re: Problem with &quot;escape d characters&quot ; not all double quotes show up?

                  this works and validates

                  $tdsubclass="<t d class=\"sup\">< a
                  href=\"http://d19952.u48.suro wn.dk/bbel.php/$artnr[$arayartnrcount er]\"


                  onmouseover=\"w indow.status =
                  'http://www.fup.dk/$artnr[$arayartnrcount er]';
                  return true;\"
                  onmouseout=\"wi ndow.status = return true;\"><!--target=\"_Self\ "-->
                  ";

                  Comment

                  • Ken Robinson

                    #10
                    Re: Problem with &quot;escape d characters&quot ; not all double quotes show up?



                    madsgormlarsen@ gmail.com wrote (in part):[color=blue]
                    >
                    > I figured the problem here is with PHP and not javascript, because the
                    > problem is to get PHP to echo the java code. Because the java code
                    > works just fine, but I could not get PHP to echo it with the double
                    > quetes I need.
                    >[/color]

                    Please, when refering to Javascript, spell it out. Do not use "java",
                    since that is a completely different language.

                    Ken

                    Comment

                    Working...