how to output semicolon with php

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

    how to output semicolon with php

    hi! thanx for reading!

    my problem: I want to print :
    7] Xerox: print '<a href='.
    '"javascript:;" '.
    "onClick='hideA ll(); showHideLayers ('s6','','show' )'>
    test</a>";

    with php

    but I can't get it work becouse php ends reading efter ; but I have to have
    it printed.. how do I acheff it?


  • MeerKat

    #2
    Re: how to output semicolon with php

    Carramba wrote:[color=blue]
    > hi! thanx for reading!
    >
    > my problem: I want to print :
    > 7] Xerox: print '<a href='.
    > '"javascript:;" '.
    > "onClick='hideA ll(); showHideLayers ('s6','','show' )'>
    > test</a>";
    >
    > with php
    >
    > but I can't get it work becouse php ends reading efter ; but I have to have
    > it printed.. how do I acheff it?[/color]

    I don't think it does. The source of your document will be:

    <a href="javascrip t:;"onClick='hi deAll(); showHideLayers ('s6','','show' )'>
    test</a>

    Unless I've completely misunderstood your question.

    --
    MeerKat

    Comment

    • Carramba

      #3
      Re: how to output semicolon with php

      the output is:
      <a href="javascrip t:;"onClick='hi deAll(); showHideLayers( 'd2','','show') '>
      test</a>

      I need it to by <a href="javascrip t:;" onClick="hideAl l();
      showHideLayers( 'd2','','show') "> test</a>

      now I can't get out pu of " .. eah..

      I have tryed

      print '<a href='.'"javasc ript:;"'.'onCli ck='.'"hideAll( );
      showHideLayers( 'd2','','show') "'.'> test</a>';
      then I get error : parse error, unexpected T_STRING ...


      Comment

      • MeerKat

        #4
        Re: how to output semicolon with php

        Carramba wrote:
        [color=blue]
        > the output is:
        > <a href="javascrip t:;"onClick='hi deAll(); showHideLayers( 'd2','','show') '>
        > test</a>
        >
        > I need it to by <a href="javascrip t:;" onClick="hideAl l();
        > showHideLayers( 'd2','','show') "> test</a>
        >
        > now I can't get out pu of " .. eah..
        >
        > I have tryed
        >
        > print '<a href='.'"javasc ript:;"'.'onCli ck='.'"hideAll( );
        > showHideLayers( 'd2','','show') "'.'> test</a>';
        > then I get error : parse error, unexpected T_STRING ...
        >
        >[/color]

        Try this:

        print "<a href=\"javascri pt:;\" onClick=\"hideA ll();
        showHideLayers( 'd2','','show') \">test</a>";

        Notice I've escaped (ie, added \) all the double quotes, except those
        around the whole string.

        --
        MeerKat

        Comment

        • Carramba

          #5
          Re: how to output semicolon with php

          thanx mate!

          it worked just fine.. I was trying same thing but wasn't near.. can you
          explain why it's works like that?


          print "<a href=\"javascri pt:;\" onClick=\"hideA ll();
          showHideLayers( 'd2','','show') \">test</a>";

          u start with \ " and finish with \" thought it was like \"somestring "\ ...
          its more logical for me.. tag start \ tag ends \ ... hoppe you have time to
          explayn so I would need to ask similar qestions...

          and thanx again!


          "MeerKat" <liquidlaughter 2000@blueyonder .co.uk> skrev i meddelandet
          news:MRu0b.1550 $jK.12925126@ne ws-text.cableinet. net...[color=blue]
          > Carramba wrote:
          >[color=green]
          > > the output is:
          > > <a href="javascrip t:;"onClick='hi deAll();[/color][/color]
          showHideLayers( 'd2','','show') '>[color=blue][color=green]
          > > test</a>
          > >
          > > I need it to by <a href="javascrip t:;" onClick="hideAl l();
          > > showHideLayers( 'd2','','show') "> test</a>
          > >
          > > now I can't get out pu of " .. eah..
          > >
          > > I have tryed
          > >
          > > print '<a href='.'"javasc ript:;"'.'onCli ck='.'"hideAll( );
          > > showHideLayers( 'd2','','show') "'.'> test</a>';
          > > then I get error : parse error, unexpected T_STRING ...
          > >
          > >[/color]
          >
          > Try this:
          >
          > print "<a href=\"javascri pt:;\" onClick=\"hideA ll();
          > showHideLayers( 'd2','','show') \">test</a>";
          >
          > Notice I've escaped (ie, added \) all the double quotes, except those
          > around the whole string.
          >
          > --
          > MeerKat
          >
          >[/color]


          Comment

          • MeerKat

            #6
            Re: how to output semicolon with php

            Carramba wrote:
            [color=blue]
            > thanx mate![/color]

            No problem.
            [color=blue]
            > it worked just fine.. I was trying same thing but wasn't near.. can you
            > explain why it's works like that?[/color]

            I'll try... :)

            The \ characters are not tags. They are -not- there to 'start' and 'end'
            a piece of text. They are there to say that the next character should be
            treated as part of the string and not as anything 'special'. So \" means
            that the double quote should be outputted.

            I hope this helps.

            MK.
            [color=blue]
            > print "<a href=\"javascri pt:;\" onClick=\"hideA ll();
            > showHideLayers( 'd2','','show') \">test</a>";
            >
            > u start with \ " and finish with \" thought it was like \"somestring "\ ...
            > its more logical for me.. tag start \ tag ends \ ... hoppe you have time to
            > explayn so I would need to ask similar qestions...
            >
            > and thanx again!
            >
            >
            > "MeerKat" <liquidlaughter 2000@blueyonder .co.uk> skrev i meddelandet
            > news:MRu0b.1550 $jK.12925126@ne ws-text.cableinet. net...
            >[color=green]
            >>Carramba wrote:
            >>
            >>[color=darkred]
            >>>the output is:
            >>><a href="javascrip t:;"onClick='hi deAll();[/color][/color]
            >
            > showHideLayers( 'd2','','show') '>
            >[color=green][color=darkred]
            >>>test</a>
            >>>
            >>>I need it to by <a href="javascrip t:;" onClick="hideAl l();
            >>>showHideLaye rs('d2','','sho w')"> test</a>
            >>>
            >>>now I can't get out pu of " .. eah..
            >>>
            >>>I have tryed
            >>>
            >>>print '<a href='.'"javasc ript:;"'.'onCli ck='.'"hideAll( );
            >>>showHideLaye rs('d2','','sho w')"'.'> test</a>';
            >>>then I get error : parse error, unexpected T_STRING ...
            >>>
            >>>[/color]
            >>
            >>Try this:
            >>
            >>print "<a href=\"javascri pt:;\" onClick=\"hideA ll();
            >>showHideLayer s('d2','','show ')\">test</a>";
            >>
            >>Notice I've escaped (ie, added \) all the double quotes, except those
            >>around the whole string.
            >>
            >>--
            >>MeerKat
            >>
            >>[/color]
            >
            >
            >[/color]

            --
            MeerKat

            Comment

            • Carramba

              #7
              Re: how to output semicolon with php

              ok!

              know I get it!

              thanx!


              "MeerKat" <liquidlaughter 2000@blueyonder .co.uk> skrev i meddelandet
              news:cdv0b.1577 $xY1.14518421@n ews-text.cableinet. net...[color=blue]
              > Carramba wrote:
              >[color=green]
              > > thanx mate![/color]
              >
              > No problem.
              >[color=green]
              > > it worked just fine.. I was trying same thing but wasn't near.. can you
              > > explain why it's works like that?[/color]
              >
              > I'll try... :)
              >
              > The \ characters are not tags. They are -not- there to 'start' and 'end'
              > a piece of text. They are there to say that the next character should be
              > treated as part of the string and not as anything 'special'. So \" means
              > that the double quote should be outputted.
              >
              > I hope this helps.
              >
              > MK.
              >[color=green]
              > > print "<a href=\"javascri pt:;\" onClick=\"hideA ll();
              > > showHideLayers( 'd2','','show') \">test</a>";
              > >
              > > u start with \ " and finish with \" thought it was like \"somestring "\[/color][/color]
              ....[color=blue][color=green]
              > > its more logical for me.. tag start \ tag ends \ ... hoppe you have time[/color][/color]
              to[color=blue][color=green]
              > > explayn so I would need to ask similar qestions...
              > >
              > > and thanx again!
              > >
              > >
              > > "MeerKat" <liquidlaughter 2000@blueyonder .co.uk> skrev i meddelandet
              > > news:MRu0b.1550 $jK.12925126@ne ws-text.cableinet. net...
              > >[color=darkred]
              > >>Carramba wrote:
              > >>
              > >>
              > >>>the output is:
              > >>><a href="javascrip t:;"onClick='hi deAll();[/color]
              > >
              > > showHideLayers( 'd2','','show') '>
              > >[color=darkred]
              > >>>test</a>
              > >>>
              > >>>I need it to by <a href="javascrip t:;" onClick="hideAl l();
              > >>>showHideLaye rs('d2','','sho w')"> test</a>
              > >>>
              > >>>now I can't get out pu of " .. eah..
              > >>>
              > >>>I have tryed
              > >>>
              > >>>print '<a href='.'"javasc ript:;"'.'onCli ck='.'"hideAll( );
              > >>>showHideLaye rs('d2','','sho w')"'.'> test</a>';
              > >>>then I get error : parse error, unexpected T_STRING ...
              > >>>
              > >>>
              > >>
              > >>Try this:
              > >>
              > >>print "<a href=\"javascri pt:;\" onClick=\"hideA ll();
              > >>showHideLayer s('d2','','show ')\">test</a>";
              > >>
              > >>Notice I've escaped (ie, added \) all the double quotes, except those
              > >>around the whole string.
              > >>
              > >>--
              > >>MeerKat
              > >>
              > >>[/color]
              > >
              > >
              > >[/color]
              >
              > --
              > MeerKat
              >
              >[/color]


              Comment

              • haptiK

                #8
                Re: how to output semicolon with php

                Hello :)

                shouldnt that read more like


                echo '<a href="javascrip t:void(0);" onclick="hideAl l();
                showHideLayers( 's6','','show') ">test</a>';

                much easier to read... why even echo it at all though?


                -jpdr
                TTG

                Carramba wrote:
                [color=blue]
                > hi! thanx for reading!
                >
                > my problem: I want to print :
                > 7] Xerox: print '<a href='.
                > '"javascript:;" '.
                > "onClick='hideA ll(); showHideLayers ('s6','','show' )'>
                > test</a>";
                >
                > with php
                >
                > but I can't get it work becouse php ends reading efter ; but I have to have
                > it printed.. how do I acheff it?
                >
                >[/color]

                Comment

                • Carramba

                  #9
                  Re: how to output semicolon with php

                  yeah.. why not...

                  I can't tell you I just use print, becouse echo is like more calling php and
                  functions etc.. but you are 100% right it's work greate too..


                  "haptiK" <nospam@nospam. com> skrev i meddelandet
                  news:bhvc14$g6t $2@titan.btinte rnet.com...[color=blue]
                  > Hello :)
                  >
                  > shouldnt that read more like
                  >
                  >
                  > echo '<a href="javascrip t:void(0);" onclick="hideAl l();
                  > showHideLayers( 's6','','show') ">test</a>';
                  >
                  > much easier to read... why even echo it at all though?
                  >
                  >
                  > -jpdr
                  > TTG
                  >
                  > Carramba wrote:
                  >[color=green]
                  > > hi! thanx for reading!
                  > >
                  > > my problem: I want to print :
                  > > 7] Xerox: print '<a href='.
                  > > '"javascript:;" '.
                  > > "onClick='hideA ll(); showHideLayers ('s6','','show' )'>
                  > > test</a>";
                  > >
                  > > with php
                  > >
                  > > but I can't get it work becouse php ends reading efter ; but I have to[/color][/color]
                  have[color=blue][color=green]
                  > > it printed.. how do I acheff it?
                  > >
                  > >[/color]
                  >
                  >[/color]


                  Comment

                  Working...