Copy link to clipboard
Copied
i have an input field <textarea name="terms" cols="60" rows="5"><?php echo htmlentities($row_Recordset1['terms'], ENT_COMPAT, 'utf-8'); ?></textarea>
the php is
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form4")) {
$updateSQL = sprintf("UPDATE think_terms SET terms=%s WHERE termsID=%s",
GetSQLValueString($_POST['terms'], "text"),
GetSQLValueString($_POST['termsID'], "int"));
the results is
<div class="textblack" id="terms_body"><?php echo $row_Recordset1['terms']; ?></div>
it is all coming out as one block
when the text is inputed it is like this
"The standard Lorem Ipsum passage, used since the 1500s
"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. "
but when display it comes out like
The standard Lorem Ipsum passage, used since the 1500s "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
i tried the "/n" in the <div class="textblack" id="terms_body"><?php echo $row_Recordset1['terms']; ?></div>
but that didnt work
<?php echo nl2br($row_Recordset1['terms']); ?>
done it, thanks for the advice
jon
Copy link to clipboard
Copied
>i tried the "/n" in the <div class="textblack" id="terms_body"><?php echo $row_Recordset1['terms']; ?></div>
"/n" ? Not sure what you mean. When you hit RETURN on the keyboard, a newline character is inserted. Newlines, carriage returns, etc, are all just whitespace. Remember what HTML does to whitespace? Try using the nl2br function.
Copy link to clipboard
Copied
i take it the nl2br goes in the results
looking at tutorial is says it can go after the echo so by php is
<?php echo $row_Recordset1['terms']; ?>
<?php echo nl2br $row_Recordset1['terms']; ?>
but this is giving syntax errors
where is it meant to go then?
Copy link to clipboard
Copied
<?php echo nl2br($row_Recordset1['terms']); ?>
done it, thanks for the advice
jon