Hiding HTML tags in form

liunx

Guest
The following code works fine - using PHP to call a variable which populates my online form with content... but how do I bring up the content so that the HTML tags are not ignored, but hidden?<br />
<br />
function show_editor_title($pg1, $pg2)<br />
{<br />
?><br />
<br />
<form method=post action="show_page.php"><br />
<table bgcolor="#cccccc" width="280"><br />
<tr><br />
<?php<br />
if ($pg1) print '<td>Page 1 Text:</td></tr><tr><td>';<br />
if ($pg2) print '<td>Page 2 Text:</td></tr><tr><td>';<br />
?><br />
<br />
<TEXTAREA name="<?php<br />
if ($pg1) print 'pg1';<br />
if ($pg2) print 'pg2';<br />
?>" <br />
<br />
ROWS="10" COLS="80"><br />
<br />
<?php <br />
if ($pg1) print $pg1;<br />
if ($pg2) print $pg2;<br />
?><br />
<br />
</TEXTAREA><br />
</td><br />
</tr><br />
<tr><br />
<td colspan="2" align="center"><br />
<input type="submit" value="View"><br />
</td><br />
</tr><br />
</table></form><!--content--><input type="hidden" name="xxxx" value="xxxx" /><!--content-->Originally posted by BusyView <br />
how do I bring up the content so that the HTML tags are not ignored, but hidden? You can't. Read fredmv's sticky in the JavaScript Forum. ;)<br />
<br />
**EDIT**<br />
Are you trying to hide your source, or simply make a hidden HTML input element? Keep in mind though, <input type="hidden value="" /> does not stopthe user from seeing the value of the input element. This is simply a way to store values so they can be reached at any time, or sent across multiple pages.<!--content-->I'm displaying a form with content already displayed for a user to re-edit and save (to MySQL database). I merely want the content to be displayed without <BR /> tags showing, and the like.<!--content-->Oh. Well, textareas won't implement html, simply display it. you could run a string replace:<br />
<br />
<br />
$pg1 = str_replace("<br />", "\n", $pg1);<br />
$pg2 = str_replace("<br />", "\n", $pg2);<!--content-->Magic... this was exactly what I was looking for... should have realised I had to use str_replace.... bit slow on the uptake!<!--content-->
 
Back
Top