Ah. So I should being using quotes for everything after an =, then? So for font color as well?
Buffistas Building a Better Board
Do you have problems, concerns or recommendations about the technical side of the Phoenix? Air them here. Compliments also welcome.
Yup.
Thanks for that PHP stuff Gar, I did actually know that you can use arrays in order and as associative arrays, but coming from a Perl background where one has to be a @ and the other has to be a %, it freaks me out when everything's a $.
It's like that Stephen Wright gag about the thermos: put something hot in it, it keeps it hot, put something cold in it, it keeps it cold -- but how does it know?
OK the thing about whether stuff gets enclosed in quotes?
Technically speaking, it's about what type of characters are in the attribute's value.
[for people who may not know the terminology -- in <font color="white"> "font" is the tag, "color" is the attribute, and "white" is the attribute's value.]
If you do a syntax check, you'll get an error message for
width=50%
but not for
width=50
because "50" contains alphanumeric characters only, but the per cent sign isn't alphanumeric.
Similarly, you'll get an error for:
font color=#ffffff
but not
font color=white
for the same reason, which kind of seems wrong to me.
But this only applies to non-strict versions of HTML only, like the one we use here. Other versions require much more rigour and everything to be in quotes. Plus it always comes down to the browser's level of forgiveness anyway. Your browser might be happy with it, but not someone else's.
So ita's right, of course, always enclose things in quotes, yes. But please use the same ones at the end you use at the start...
Okay. Using quotes, and using them twice. Got it.
Thanks for that PHP stuff Gar, I did actually know that you can use arrays in order and as associative arrays, but coming from a Perl background where one has to be a @ and the other has to be a %, it freaks me out when everything's a $.
But the end() function actually did help, right? The rest was just a thought that if you did not know the end() command, you might have missed some of the other functions.
And, yeah the one thing you have to get used to in PHP is how it makes your life easier. Except when it makes your life harder. Or impossible. In short, just like any other programming language.
Not only did the "end()" function help, I've finished a prototype tag-syntax checker at [link] on the strength of it.
I say "tag-syntax" checker because it won't figure out problems with quotes.
It uses Method A (ordered array) and Method B (associative array), but if B is happy it over-rides A.
It explains what it's doing, so just play with it.
For testing, it just checks the integrity of any lowercase bold, italic and font tags, but you know, proof of concept.
I tried it, John, and it doesn't seem to catch any errors at all.
I put in
a <bold> a <bold> a <bold> a </bold>
and it spit out
found tags: bold, bold, bold, /bold, Trying to match openers and closers: Diagnosing: Length of outstanding tags array: 0 Sum for each tag (opener +1, closer -1): bold count = Sum of all tags: 0 Conclusion: code passes both tests and appears unbroken.