Jay Blanchard wrote:

So Jason you learned three valuable lessons today.

a. plan your code (use paper and pencil or something like it)
b. always account for security
c. comment properly


I'll add two more:

d: Check the source that your script outputs. Send it to the W3C validator (WebDeveloper Firefox extension is one of your bestest ever friends).

e: (my personal opinion) Using echo() to spit out HTML will lead to *much* heartache and gnashing of teeth. Put a closing PHP tag ("?>") in there and let the parser spit out the markup without echo().

either:

-- snip --
while($row = mysql_fetch_assoc($result))
{
?>
  <tr>
  <td><?= $row['FName'] ?></td>
  <td><?= $row['LName'] ?></td>
  <td><?= $row['Add1'] ?></td>
...
<?php
}
-- snip --

or:

-- snip --
while($row = mysql_fetch_assoc($result))
{
?>
  <tr>
  <td><?php echo $row['FName'] ?></td>
  <td><?php echo $row['LName'] ?></td>
  <td><?php echo $row['Add1'] ?></td>
...
<?php
}
-- snip --

or, as i said, use a template system.

brian

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to