I know I am missing something simple. I have a form with one of the fields being a text area. I need to retain the line breaks as part of the formatting for later display. I have tried eregi_replace, manually entering <br> in the text field and nl2br() and they all keep breaking the insert.
code after submission of the form:
if ($submit) {
$pulldate = $pullyy.$pullmm.$pulldd;
$nl_text=nl2br($nl_text);
include "entry_proc.php";
}//end if submit
entry_proc.php:
mysql_pconnect("localhost", "xxx", "xxx");
mysql_select_db ("xxx") or die ("Unable to select database");
$query = "insert into newsletter
(title, filecode, pulldate, specialist, contact, focusissue, nl_text)
values
('$title', '$filecode', '$pulldate', '$specialist', '$contact', '$focusissue', '$nl_text')";
echo $query;
$result = mysql_query($query) or die ("no insert into database");
I did have a page that displays the text for the user before they submit (so they can approve it) - that sometimes submits ok but when I passed all the variables as hidden values it would display part of the text (after the second <br>) at the top of the page as well as where I displayed it for them.
I'm a good bit stuck so any help is appreciated. I was put in a job instantly having to write applications so my php knowledge is allot of 'make do'. The hard stuff I can handle - easy stuff makes me crazy!