> if you have ever worked in a fast paced production environment, where
> html is changed sometimes 5 times a day, digging through hundreds
> of lines of:
>
> echo "<input type=\"text\" name=\"hello\" size=\"20\"
> value=\"$value\">"
>
> starts to make you insane.
That's pretty ugly.
echo "<input type='text' name='hello' size='20' value='$value'>";
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.
> : _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 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.
However, each to their own - your way works for you and your team,
mine works for me and mine :)
Jason
--
Jason Murray
[EMAIL PROTECTED]
Web Design Team, Melbourne IT
Fetch the comfy chair!
--
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]