469,270 Members | 1,120 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,270 developers. It's quick & easy.

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?
Jul 16 '05 #1
8 10361
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

Jul 16 '05 #2
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 ...
Jul 16 '05 #3
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

Jul 16 '05 #4
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" <li****************@blueyonder.co.uk> skrev i meddelandet
news:MR********************@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

Jul 16 '05 #5
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" <li****************@blueyonder.co.uk> skrev i meddelandet
news:MR********************@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

Jul 16 '05 #6
ok!

know I get it!

thanx!
"MeerKat" <li****************@blueyonder.co.uk> skrev i meddelandet
news:cd*********************@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" <li****************@blueyonder.co.uk> skrev i meddelandet
news:MR********************@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

Jul 16 '05 #7
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?


Jul 16 '05 #8
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" <no****@nospam.com> skrev i meddelandet
news:bh**********@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?


Jul 16 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Bruce W...1 | last post: by
42 posts views Thread by Prashanth Badabagni | last post: by
17 posts views Thread by subnet | last post: by
5 posts views Thread by Sweety | last post: by
20 posts views Thread by dis_is_eagle | last post: by
3 posts views Thread by Peter Michaux | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.