[Phpmyadmin-devel] pretty code, buggy code?

Marc Delisle lem9 at users.sourceforge.net
Tue Jul 31 11:53:17 CEST 2001


Hi,

sometimes we want to beautify the code by inserting line feeds, like
this:

<textarea name="fields[<?php echo urlencode($field); ?>]"
  rows="<?php echo $cfgTextareaRows; ?>"
  cols="<?php echo $cfgTextareaCols; ?>">
<?php if (!empty($special_chars)) echo $special_chars . "\n"; ?>
</textarea>

The problem here is the line feed inserted before the last <?php, it
inserts
unwanted characters into the textarea.

Correct code will not be so pretty:

<textarea name="fields[<?php echo urlencode($field); ?>]"
  rows="<?php echo $cfgTextareaRows; ?>"
  cols="<?php echo $cfgTextareaCols; ?>"><?php if
(!empty($special_chars)) echo $special_chars . "\n"; ?>
</textarea>

Marc





More information about the Developers mailing list