473,241 Members | 1,517 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,241 software developers and data experts.

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 10541
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Bruce W...1 | last post by:
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 NOT REMOVE THIS LINE one = 1 five = 5 path =...
1
by: Asteras | last post by:
Hi All!!! Let us consider two tables in a MySQL database: 1) C_T is a table of school classes and the teachers that teach in them: select * from C_T; +-------+---------+
42
by: Prashanth Badabagni | last post by:
Hi, Can any body tell me how to print "hello,world" with out using semicolon Thanks in advance .. Bye Prashanth Badabagni
17
by: subnet | last post by:
I'm not a C expert, but I've seen this topic discussed in the newsgroup several times. What's the deal with writing such programs? Why are they considered so interesting? Thanks
5
by: Sweety | last post by:
Plz i need full explanation ? #include<stdio.h> int main() { for(;0;) printf("hello") ; return 0 ; }
3
by: Dan | last post by:
I'm writing a record from an asp.net page to SQL Server. After the insert I'm selecting @@identity to return the ID of the record that I just wrote. It worked fine until I typed a semicolon into...
3
by: Jeff | last post by:
This is not as simple as I thought. Using Print # I am outputting content for a text file. I wanted at certain points to force a page break so I thought a Chr(12) for a form feed may work. If...
20
by: dis_is_eagle | last post by:
Hi.I could not understand the output of the following program. #define swap(a,b) temp=a; a=b; b=temp; int main( ) { int i, j, temp; i=5; j=10; temp=0; if( i j)
3
by: Peter Michaux | last post by:
Hi, These first three links say that when reading document.cookie the name-value pairs are separated by semicolons and they show examples like "name=value;expires=date" where there is clearly...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.