[plug] PHP formatting mystery

Onno Benschop onno at itmaze.com.au
Wed Jun 16 04:39:30 WST 2004


On Wed, 2004-06-16 at 05:26, Garry wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Can anyone tell me why this text will not align for me?

You are going to kick yourself when I tell you...


The output will have nested <p> tags because the string has them and the
HTML has too...

Can I also point out that repeating <br> is non-standard HTML because it
should be rendered as one line break, though some browsers will likely
render it as more.

Also, using double quotes (") rather than single ones ('), without the
need for any variable substitution is a waste of CPU cycles.

Finally, alternating HTML and PHP like that is fine for a tiny file, but
in a real program you are going to write some pretty hideous code if you
go down that way.

Feel free to ignore me.


> <?php
> 
> $empty_fields_message = "<p>Please go back and complete all the fields
> in the form.</p>";
> 
> ?>
> <HTML><BODY
> bgcolor="#FFCC66"><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
> <p align=centre><?php echo $empty_fields_message;?></p>
> </HTML></BODY>
> 
> 
> Or is there a trick to get PHP script results formatted?
> 
> TIA
> 
> Garry
> 
> 
> 
> 
> 
> 
> 
> 
> 
> - --
> 
> 
> 
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (GNU/Linux)
> 
> iD8DBQFAz01pvdH9DANniC8RAgotAKCf52FNGZKswY4Zeje5ItZcVG79vACfQdNo
> pqNCThJZSKXdcAthVcw4sjE=
> =/kie
> -----END PGP SIGNATURE-----
> _______________________________________________
> PLUG discussion list: plug at plug.linux.org.au
> http://mail.plug.linux.org.au/cgi-bin/mailman/listinfo/plug
> Committee e-mail: committee at plug.linux.org.au
Onno Benschop 

Connected via Optus B3 at S27°52'30" - E151°16'25" (Millmerran, QLD)
-- 
()/)/)()        ..ASCII for Onno.. 
|>>?            ..EBCDIC for Onno.. 
--- -. -. ---   ..Morse for Onno.. 

Proudly supported by Skipper Trucks, Highway1, Concept AV, Sony Central, Dalcon
ITmaze - ABN: 56 178 057 063 - ph: 04 1219 8888 - onno at itmaze dot com dot au




More information about the plug mailing list