Re: [PHP] echo problem NEW

2002-01-09 Thread Henning Sprang

Hy,



universal2001 wrote:

 Hi again!
 
 Thanks for the reply!
 
 I still have another question:

 
 so I tired to use (echo) like this:
 
 echo table border=0 cellpadding=0 cellspacing=0 width=639
   tr
 tdimg src=img_heading/spacer.gif width=25 height=1
 border=0/td
   /tr
   tr
 td colspan=11img name=index_r1_c1
 src=img_heading/index_r1_c1.gif width=639 height=5 border=0/td
 tdimg src=img_heading/spacer.gif width=1 height=5
 border=0/td
   /tr
   tr
 td rowspan=5img name=index_r2_c1
 src=img_heading/index_r2_c1.gif width=25 height=43 border=0/td
 /table;
 but it DOES NOT WORK.
 How do I get way with all of the quotation marks




1) you can escape each double quote with a backslash,
the first line of your thing woulkd then look like

echo table border=\0\ cellpadding=\0\ cellspacing=\0\ width=\639\

and so on

2) if you don't want this by any reason, you can use single quotes to 
mark the text you want to print out like in

echo 'table width=100%';

the difference is that with single quotes you will _not_ be able to use 
variable replacement in between the quotes, something like

?
$myvar=100;
echo table width=\$myvar\;
?

will output

table width=100%


while this:

?
$myvar=100;
echo 'table width=$myvar';
?

will output exactly

table width=$myvar


hth,
henning



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] echo problem NEW

2002-01-09 Thread Nicolas Costes

Hellorghh !!!
You'd better do like this :

echo table border='0' cellpadding='0' cellspacing='0' width='639'


Le Mercredi 9 Janvier 2002 13:05, Henning Sprang a écrit :
 Hy,

 universal2001 wrote:
  Hi again!
 
  Thanks for the reply!
 
  I still have another question:
 
 
  so I tired to use (echo) like this:
 
  echo table border=0 cellpadding=0 cellspacing=0 width=639
tr
  tdimg src=img_heading/spacer.gif width=25 height=1
  border=0/td
/tr
tr
  td colspan=11img name=index_r1_c1
  src=img_heading/index_r1_c1.gif width=639 height=5 border=0/td
  tdimg src=img_heading/spacer.gif width=1 height=5
  border=0/td
/tr
tr
  td rowspan=5img name=index_r2_c1
  src=img_heading/index_r2_c1.gif width=25 height=43 border=0/td
  /table;
  but it DOES NOT WORK.
  How do I get way with all of the quotation marks

 1) you can escape each double quote with a backslash,
 the first line of your thing woulkd then look like

 echo table border=\0\ cellpadding=\0\ cellspacing=\0\
 width=\639\

 and so on

 2) if you don't want this by any reason, you can use single quotes to
 mark the text you want to print out like in

 echo 'table width=100%';

 the difference is that with single quotes you will _not_ be able to use
 variable replacement in between the quotes, something like

 ?
 $myvar=100;
 echo table width=\$myvar\;
 ?

 will output

 table width=100%


 while this:

 ?
 $myvar=100;
 echo 'table width=$myvar';
 ?

 will output exactly

 table width=$myvar


 hth,
 henning

-- 
 ( * Nicolas Costes,
 //\\  IUT de La Roche / Yon
( \/ ) [EMAIL PROTECTED]
http://luxregina.free.fr

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] echo problem NEW

2002-01-09 Thread Henning Sprang

Nicolas Costes wrote:

 Hellorghh !!!
 You'd better do like this :
 
 echo table border='0' cellpadding='0' cellspacing='0' width='639'

 

just another one - but i am too out of practice with html standarts to 
know if this is compliant ( a browser showing a result doesn't 
neccessary mean it's standarts compliant!)

henning





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] echo problem NEW

2002-01-09 Thread Nicolas Costes


Yes, you're right !!!

some browsers like IE will accept even  blah blah=0, blah blah='0', blah 
blah=0, and some like Opera will only understand :
IE SuxWithTooEasySyntax=1 ;-))

Le Mercredi 9 Janvier 2002 14:17, Henning Sprang a écrit :
 Nicolas Costes wrote:

-- 
 ( * Nicolas Costes,
 //\\  IUT de La Roche / Yon
( \/ ) [EMAIL PROTECTED]
http://luxregina.free.fr

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] echo problem NEW

2002-01-09 Thread Bas van Rooijen


Hello,

In addition to Henning Sprang's fine solutions, you can also do the following (given 
you use PHP 4);


? $xmp_width = 5;
 $xmp_tdcolor = #FF;
 $xmp_text = Some text;

   echo EOF

TABLE WIDTH={$xmp_width}
TRTD COLOR={$xmp_tdcolor}$xmp_text/TD/TR
/TABLE

EOF;
   
?

Note that the {} around your variables are optional, they will not be included in the 
output but can be used to avoid confusion.

greets,

bvr.


On Wed, 9 Jan 2002 15:00:55 +0700, universal2001 wrote:

Hi again!

Thanks for the reply!

I still have another question:

I want to create a recycleable code by printing a set of html code which I
copied and paste from my html edittor.

however because there are lots of quotation marks on the html code it result
an error page.





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] echo problem NEW

2002-01-09 Thread Paul Burney

on 1/9/02 8:17 AM, Henning Sprang at [EMAIL PROTECTED] appended the
following bits to my mbox:

 just another one - but i am too out of practice with html standarts to
 know if this is compliant ( a browser showing a result doesn't
 neccessary mean it's standarts compliant!)

FYI:

By default, SGML requires that all attribute values be delimited using
either double quotation marks (ASCII decimal 34) or single quotation marks
(ASCII decimal 39). Single quote marks can be included within the attribute
value when the value is delimited by double quote marks, and vice versa.
Authors may also use numeric character references to represent double quotes
(#34;) and single quotes (#39;). For double quotes authors can also use
the character entity reference quot;.

From:

http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.2

HTH.

Paul Burney

?php
while ($self != asleep) {
$sheep_count++;
}
?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] echo problem NEW

2002-01-08 Thread Steven Cayford

On 2002.01.09 02:00:55 -0600 universal2001 wrote:

 so I tired to use (echo) like this:
 
 echo table border=0 cellpadding=0 cellspacing=0 width=639
   tr
 tdimg src=img_heading/spacer.gif width=25 height=1
 border=0/td
   /tr
   tr
 td colspan=11img name=index_r1_c1
 src=img_heading/index_r1_c1.gif width=639 height=5 border=0/td
 tdimg src=img_heading/spacer.gif width=1 height=5
 border=0/td
   /tr
   tr
 td rowspan=5img name=index_r2_c1
 src=img_heading/index_r2_c1.gif width=25 height=43 border=0/td

Try to think like a computer program. It sees the command:
echo table border=
followed by a (meaningless to it) 0 and more quoted text, and another 0, 
etc...

The first and last quotes are really part of your command to php, the 
others should be treated as harmless text and passed on to the browser as 
part of your html. You can tell php to treat quotes as text by escaping 
them: putting a \ in front of them like this:

echo table border=\0\;

Or you could drop out of php mode entirely to do your html like this:

?php
...php stuff here ...
?

table border=0

?php
...more php stuff...
?

One of these methods should get you going.

-Steve

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] echo problem NEW

2002-01-08 Thread CC Zona

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Steven Cayford) wrote:

 You can tell php to treat quotes as text by escaping 
 them: putting a \ in front of them like this:
 
 echo table border=\0\;
 
 Or you could drop out of php mode entirely to do your html like this:
 
 ?php
 ...php stuff here ...
 ?
 
 table border=0
 
 ?php
 ...more php stuff...
 ?
 
 One of these methods should get you going.

There's also the heredoc option (variable interpolation, no need to escape 
of quotes, no jumping back and forth between PHP mode and HTML mode) 
http://www.php.net/manual/language.types.string.php:

echoEOF;
table border=$bordersize
   tr
   td$mycontent/td
   tr
/table

style type=text/css
.$classname { margin: 10px; background-color: black; color: white; }
/style

 p class=$classnameBlah blah.../p
EOF;

-- 
CC

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] echo problem NEW

2002-01-08 Thread Steve Maroney



I simply use single quotes for html and double quotes for PHP.

echo table border='1' cellpadding='0' cellspacing='0' width='620';

works for me.


Steve


On Tue, 8 Jan 2002, Steven Cayford wrote:

 On 2002.01.09 02:00:55 -0600 universal2001 wrote:

  so I tired to use (echo) like this:
 
  echo table border=0 cellpadding=0 cellspacing=0 width=639
tr
  tdimg src=img_heading/spacer.gif width=25 height=1
  border=0/td
/tr
tr
  td colspan=11img name=index_r1_c1
  src=img_heading/index_r1_c1.gif width=639 height=5 border=0/td
  tdimg src=img_heading/spacer.gif width=1 height=5
  border=0/td
/tr
tr
  td rowspan=5img name=index_r2_c1
  src=img_heading/index_r2_c1.gif width=25 height=43 border=0/td

 Try to think like a computer program. It sees the command:
 echo table border=
 followed by a (meaningless to it) 0 and more quoted text, and another 0,
 etc...

 The first and last quotes are really part of your command to php, the
 others should be treated as harmless text and passed on to the browser as
 part of your html. You can tell php to treat quotes as text by escaping
 them: putting a \ in front of them like this:

 echo table border=\0\;

 Or you could drop out of php mode entirely to do your html like this:

 ?php
 ...php stuff here ...
 ?

 table border=0

 ?php
 ...more php stuff...
 ?

 One of these methods should get you going.

 -Steve

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]










Thank you,
Steve Maroney





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]