Re: Text area with an echo command
| From: | Eugene Lee | Date: | Sat, 18 Oct 2003 05:35:48 +0000 |
| Subject: | Re: Text area with an echo command | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-166603@lists.php.net to get a copy of this message | ||
On Sat, Oct 18, 2003 at 01:27:05AM -0400, Will wrote:
:
: Thanks for the code but it comes up a parse error. I know I am new, but
: this is driving me crazy!!! :(
: Here is the code that I am working with:
:
: $display_block = "
: <form method=\"POST\" action=\"do_note_modify.php\">
: <input type=\"hidden\" name=\"notes_id\"
value=\"$_POST[notes_id]\">
: <input type=\"hidden\" name=\"care_id\" value=\"$care_id\">
: <input type=\"hidden\" name=\"common\" value=\"$common\">
: <input type=\"hidden\" name=\"notes\">
:
: <p><b>||Cage No.: <font color=\"#ff0000\">$care_id</font> |
Common Name:
: <font color=\"#ff0000\">$common</font>||</b></p>
:
: <p><b>Date:</b><br>
: <input type=\"text\" name=\"date\" value=\"$date\"
size=\"40\"></p>
:
: echo "<p><b>Notes:</b><br>\n
: <textarea rows=5 cols=31 name=\"notes\" wrap=virtual>" .
: htmlentities($notes) . "</textarea></p>\n";
:
: <p><input type=\"submit\" name=\"submit\" value=\"Modify This
Note\"></p>
: </form>";
:
: I know it does not look right, can I take out the "echo", or must that
: stay??
Why not make life easier and use a heredoc?
$htmlnotes = htmlentities($notes);
$display_block = <<<BLOCK
<form method="POST" action="do_note_modify.php">
<input type="hidden" name="notes_id" value="$_POST[notes_id]">
<input type="hidden" name="care_id" value="$care_id">
<input type="hidden" name="common" value="$common">
<input type="hidden" name="notes">
<p><b>||Cage No.: <font color="#ff0000">$care_id</font> | Common
Name:
<font color="#ff0000">$common</font>||</b></p>
<p><b>Date:</b><br>
<input type="text" name="date" value="$date"
size="40"></p>
<p><b>Notes:</b><br>
<textarea rows=5 cols=31 name="notes"
wrap=virtual>$htmlnotes</textarea></p>
<p><input type="submit" name="submit" value="Modify This
Note"></p>
</form>
BLOCK;
echo $display_block;