it's valid to use single-quotes, double-quotes, or NO quotes.
specs, anyone?
---
The value of the attribute may be either:
A string literal, delimited by single quotes or double quotes and not
containing any occurrences of the delimiting character. (7)
http://www.w3.org/MarkUp/html-spec/
---
3.2.2 Attributes
Elements may have associated properties, called attributes, which may have
values (by default, or set by authors or scripts). Attribute/value pairs
appear before the final ">" of an element's start tag. Any number of (legal)
attribute value pairs, separated by spaces, may appear in an element's start
tag. They may appear in any order.
In this example, the id attribute is set for an H1 element:
<H1 id="section1">
This is an identified heading thanks to the id attribute
</H1>
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
(") and single quotes ('). For double quotes authors can also use
the character entity reference ".
In certain cases, authors may specify the value of an attribute without any
quotation marks. The attribute value may only contain letters (a-z and A-Z),
digits (0-9), hyphens (ASCII decimal 45), and periods (ASCII decimal 46). We
recommend using quotation marks even when it is possible to eliminate them.
Attribute names are always case-insensitive
Attribute values are generally case-insensitive. The definition of each
attribute in the reference manual indicates whether its value is
case-insensitive.
All the attributes defined by this specification are listed in the attribute
index.
http://www.w3.org/TR/1998/REC-html40-19980424/intro/sgmltut.html#h-3.2.1
-----Original Message-----
From: Chris Lee [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 11, 2001 4:22 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] mixing HTML and PHP code
It works, it works in
lynx,
netscape 4.76
netscape 6
mozilla 0.7
IE 5.5
opera 5.01
amaya 4.2.1
now I havent used any mac browsers but if it works for all those I assume it
will for Mac browsers eh.
Chris Lee
Mediawaveonline.com
"Alex Black" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > That's pretty ugly.
> >
> > echo "<input type='text' name='hello' size='20' value='$value'>";
>
> that isn't html anymore, though.
>
> even though IE and NS may be forgiving, <input type='text' isn't valid.
>
> " it is.
>
> > That's a bit better.
> > This is even better still:
> >
> > echo "<INPUT TYPE='TEXT' NAME='hello' SIZE='20' VALUE='$value'>";
> >
> > Now, I can see the PHP variable used in there a lot easier than I
> > could before. Syntax highlighting would bring it up more, too.
> >
> >> speaking as an html author, and a lover of php, _please_:
> >>
> >> <input type="text" name="hello" size="20" value="<?=$value?>">
> >>
> >> it makes the code useable.
> >
> > Actually, it makes it less useable for me.
>
> how?
>
> and what about your html production people, who needs to make changes to
it?
>
>
> >> : _never_ and I do mean that _never_ use echo for printing html.
> >>
> >> it makes your apps impossible to change, and in a production
> >> environment, that's not ok.
> >
> > What if, halfway through a page, I figure out that I need to do a
> > redirect or set a cookie?
>
> I suggest you design your applications in such a way that you separate
logic
> from markup, and preferably assemble your applications out of separate
> components that perform "categories" of logical operations. Using markup
> that is not contain echos does not preclude good application design.
>
> If you're building pages where database connections on the same page as
your
> markup, I see why you would say that. As you do larger applications,
you'll
> find that practice does not scale well:
>
> Have a look at binarycloud.com. binarycloud provides a framework for
> building large scale, robust applications that effectively separate markup
> from logic. (and it makes coffee!)
>
> > I assemble *all* the page content into a single string variable,
> > and echo it out as the last thing the script does. This way I'm
> > free to play with HTTP headers right up to that time.
>
> agh!
>
> well, ok - but I suggest that you use functions instead, and call your
html
> printing functions at the end of your script. or better, build simple
> components, and glue them together to make an application that consists of
> files that do logical operations, and files that contain markup.
>
> Dumping all that crap into a variable and printing one massive goo-ball
> isn't the route to incredible webserver performance, either.
>
> Try stress testing your installations, you'll find apache suddenly needs a
> _hideous_ amount of memory.
>
> > However, each to their own - your way works for you and your team,
> > mine works for me and mine :)
>
> And as long as you aren't publishing code, do whatever you want.
>
> But as soon as others would like to use it, those practices become a
> consideration. I had to clean all kinds of bad habits out of my sytuff
> before releasing binarycloud :)
>
> But I certainly can't integrate code into a production process that looks
> like this:
>
> echo "<html>";
> echo "<head>";
> echo "<title>$title</title>";
> echo "<link rel='stylesheet' type='text/css'
> href='resources/css/$css.css'>";
> echo "<script src='/resources/js/base_lib.js'
> language='javascript'></script>";
> echo "</head>";
> echo "<body bgcolor='#EEEEEE' text='#000000' link='#003366'
alink='#CCCCCC'
> vlink='#003366' topmargin='0' leftmargin='0' marginwidth='0'
> marginheight='0'>";
> echo "<table border='0' cellpadding='0' cellspacing='0' width='100%'
> bgcolor="#000000">";
> echo "<tr>";
> echo "<td valign='top'><img
src='resources/images/binarycloud/tmpl/fire.jpg'
> alt='' width='466' height='161' border='0'></td>";
> echo "</tr>";
> echo "</table>";
>
> it introduces a whole world of unnecessary complexity.
>
> to prove my point:
>
> get one of your friends that knows html but not PHP to look at the above,
> then this:
>
> <html>
> <head>
> <title><?=$title?></title>
> <link rel="stylesheet" type="text/css" href="resources/css/<?=$css?>.css">
> <script src="/resources/js/base_lib.js" language="javascript"></script>
> </head>
> <body bgcolor="#EEEEEE" text="#000000" link="#003366" alink="#CCCCCC"
> vlink="#003366" topmargin="0" leftmargin="0" marginwidth="0"
> marginheight="0">
> <table border="0" cellpadding="0" cellspacing="0" width="100%"
> bgcolor="#000000">
> <tr>
> <td valign="top"><img src="resources/images/binarycloud/tmpl/fire.jpg"
> alt="" width="466" height="161" border="0"></td>
> </tr>
> </table>
>
>
> and see what they have to say.
>
>
> _alex
>
>
>
> --
> 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]
>
--
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]
--
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]