By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,751 Members | 1,216 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,751 IT Pros & Developers. It's quick & easy.

how to output semicolon with php

P: n/a
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
Share this Question
Share on Google+
8 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.