how to output semicolon with php

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default how to output semicolon with php

    hi! thanx for reading!

    my problem: I want to print :
    7] Xerox: print '<a href='.
    '"javascript:;"'.
    "onClick='hideAll(); 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?


    Carramba Guest

  2. Similar Questions and Discussions

    1. cfgrid and semicolon bug
      This problem was posted way back in 2005 but I have not seen a solution to it. When querying from a database a record that contains a semicolon and...
    2. Missing semicolon problem
      I am getting the error of Missing semicolon at end of SQL statement on the LAST insert of the following code, but I don't know why. <cfquery...
    3. semicolon requested
      Can someone help me on this. I'm trying to insert data into 2 tables using cf defined statements from the insert form wizard. When I run the code in...
    4. What does a semicolon do at the beginning of a line?
      Was browsing the documentation on reading a configuration file and found this. What does a semicolon do at the beginning of a line? ; <?php DO...
    5. behavior of semicolon on return line
      Does the semicolon behave any differently for a return test statement? Example, sub validate { return shift =~ /^*\.+$/ } or sub validate
  3. #2

    Default Re: how to output semicolon with php

    Carramba wrote:
    > hi! thanx for reading!
    >
    > my problem: I want to print :
    > 7] Xerox: print '<a href='.
    > '"javascript:;"'.
    > "onClick='hideAll(); 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?
    I don't think it does. The source of your document will be:

    <a href="javascript:;"onClick='hideAll(); showHideLayers ('s6','','show')'>
    test</a>

    Unless I've completely misunderstood your question.

    --
    MeerKat

    MeerKat Guest

  4. #3

    Default Re: how to output semicolon with php

    the output is:
    <a href="javascript:;"onClick='hideAll(); showHideLayers('d2','','show')'>
    test</a>

    I need it to by <a href="javascript:;" onClick="hideAll();
    showHideLayers('d2','','show')"> test</a>

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

    I have tryed

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


    Carramba Guest

  5. #4

    Default Re: how to output semicolon with php

    Carramba wrote:
    > the output is:
    > <a href="javascript:;"onClick='hideAll(); showHideLayers('d2','','show')'>
    > test</a>
    >
    > I need it to by <a href="javascript:;" onClick="hideAll();
    > showHideLayers('d2','','show')"> test</a>
    >
    > now I can't get out pu of " .. eah..
    >
    > I have tryed
    >
    > print '<a href='.'"javascript:;"'.'onClick='.'"hideAll();
    > showHideLayers('d2','','show')"'.'> test</a>';
    > then I get error : parse error, unexpected T_STRING ...
    >
    >
    Try this:

    print "<a href=\"javascript:;\" onClick=\"hideAll();
    showHideLayers('d2','','show')\">test</a>";

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

    --
    MeerKat

    MeerKat Guest

  6. #5

    Default 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=\"javascript:;\" onClick=\"hideAll();
    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" <liquidlaughter2000@blueyonder.co.uk> skrev i meddelandet
    news:MRu0b.1550$jK.12925126@news-text.cableinet.net...
    > Carramba wrote:
    >
    > > the output is:
    > > <a href="javascript:;"onClick='hideAll();
    showHideLayers('d2','','show')'>
    > > test</a>
    > >
    > > I need it to by <a href="javascript:;" onClick="hideAll();
    > > showHideLayers('d2','','show')"> test</a>
    > >
    > > now I can't get out pu of " .. eah..
    > >
    > > I have tryed
    > >
    > > print '<a href='.'"javascript:;"'.'onClick='.'"hideAll();
    > > showHideLayers('d2','','show')"'.'> test</a>';
    > > then I get error : parse error, unexpected T_STRING ...
    > >
    > >
    >
    > Try this:
    >
    > print "<a href=\"javascript:;\" onClick=\"hideAll();
    > showHideLayers('d2','','show')\">test</a>";
    >
    > Notice I've escaped (ie, added \) all the double quotes, except those
    > around the whole string.
    >
    > --
    > MeerKat
    >
    >

    Carramba Guest

  7. #6

    Default Re: how to output semicolon with php

    Carramba wrote:
    > thanx mate!
    No problem.
    > it worked just fine.. I was trying same thing but wasn't near.. can you
    > explain why it's works like that?
    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.
    > print "<a href=\"javascript:;\" onClick=\"hideAll();
    > 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" <liquidlaughter2000@blueyonder.co.uk> skrev i meddelandet
    > news:MRu0b.1550$jK.12925126@news-text.cableinet.net...
    >
    >>Carramba wrote:
    >>
    >>
    >>>the output is:
    >>><a href="javascript:;"onClick='hideAll();
    >
    > showHideLayers('d2','','show')'>
    >
    >>>test</a>
    >>>
    >>>I need it to by <a href="javascript:;" onClick="hideAll();
    >>>showHideLayers('d2','','show')"> test</a>
    >>>
    >>>now I can't get out pu of " .. eah..
    >>>
    >>>I have tryed
    >>>
    >>>print '<a href='.'"javascript:;"'.'onClick='.'"hideAll();
    >>>showHideLayers('d2','','show')"'.'> test</a>';
    >>>then I get error : parse error, unexpected T_STRING ...
    >>>
    >>>
    >>
    >>Try this:
    >>
    >>print "<a href=\"javascript:;\" onClick=\"hideAll();
    >>showHideLayers('d2','','show')\">test</a>";
    >>
    >>Notice I've escaped (ie, added \) all the double quotes, except those
    >>around the whole string.
    >>
    >>--
    >>MeerKat
    >>
    >>
    >
    >
    >
    --
    MeerKat

    MeerKat Guest

  8. #7

    Default Re: how to output semicolon with php

    ok!

    know I get it!

    thanx!


    "MeerKat" <liquidlaughter2000@blueyonder.co.uk> skrev i meddelandet
    news:cdv0b.1577$xY1.14518421@news-text.cableinet.net...
    > Carramba wrote:
    >
    > > thanx mate!
    >
    > No problem.
    >
    > > it worked just fine.. I was trying same thing but wasn't near.. can you
    > > explain why it's works like that?
    >
    > 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.
    >
    > > print "<a href=\"javascript:;\" onClick=\"hideAll();
    > > 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" <liquidlaughter2000@blueyonder.co.uk> skrev i meddelandet
    > > news:MRu0b.1550$jK.12925126@news-text.cableinet.net...
    > >
    > >>Carramba wrote:
    > >>
    > >>
    > >>>the output is:
    > >>><a href="javascript:;"onClick='hideAll();
    > >
    > > showHideLayers('d2','','show')'>
    > >
    > >>>test</a>
    > >>>
    > >>>I need it to by <a href="javascript:;" onClick="hideAll();
    > >>>showHideLayers('d2','','show')"> test</a>
    > >>>
    > >>>now I can't get out pu of " .. eah..
    > >>>
    > >>>I have tryed
    > >>>
    > >>>print '<a href='.'"javascript:;"'.'onClick='.'"hideAll();
    > >>>showHideLayers('d2','','show')"'.'> test</a>';
    > >>>then I get error : parse error, unexpected T_STRING ...
    > >>>
    > >>>
    > >>
    > >>Try this:
    > >>
    > >>print "<a href=\"javascript:;\" onClick=\"hideAll();
    > >>showHideLayers('d2','','show')\">test</a>";
    > >>
    > >>Notice I've escaped (ie, added \) all the double quotes, except those
    > >>around the whole string.
    > >>
    > >>--
    > >>MeerKat
    > >>
    > >>
    > >
    > >
    > >
    >
    > --
    > MeerKat
    >
    >

    Carramba Guest

  9. #8

    Default Re: how to output semicolon with php

    Hello :)

    shouldnt that read more like


    echo '<a href="javascript:void(0);" onclick="hideAll();
    showHideLayers('s6','','show')">test</a>';

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


    -jpdr
    TTG

    Carramba wrote:
    > hi! thanx for reading!
    >
    > my problem: I want to print :
    > 7] Xerox: print '<a href='.
    > '"javascript:;"'.
    > "onClick='hideAll(); 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?
    >
    >
    haptiK Guest

  10. #9

    Default 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.btinternet.com...
    > Hello :)
    >
    > shouldnt that read more like
    >
    >
    > echo '<a href="javascript:void(0);" onclick="hideAll();
    > showHideLayers('s6','','show')">test</a>';
    >
    > much easier to read... why even echo it at all though?
    >
    >
    > -jpdr
    > TTG
    >
    > Carramba wrote:
    >
    > > hi! thanx for reading!
    > >
    > > my problem: I want to print :
    > > 7] Xerox: print '<a href='.
    > > '"javascript:;"'.
    > > "onClick='hideAll(); 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?
    > >
    > >
    >
    >

    Carramba Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139