I have been running a php script for listing daytes and events. It has worked fine for alomost a year, until the servers were updated with version 4.1.2.
The user would enter a description into the multiline field. Everytime they did a carriage return the text would move down to the next line. If you went in to edit an entry you would never see any code.
But now, even though I do a carriage return the lines are still on the same line and code appears when I go into edit.
Example:
Test
<br />
Line 1
<br />
Line 2
<br />
Line 3
<br />
Here is a bit of code that I am using that I think could be the problem. I think it could be ereg_replace.
$sql2 = "UPDATE 2ndstreetEvents SET Date = \"$Date\", Event = \"".ereg_replace(" "," ",nl2br(htmlentities($Event)))."\", Description = \"".ereg_replace(" "," ",nl2br(htmlentities($Description)))."\" where ID = \"$ID\"";
$result2 = @($sql2, $connection2) or die("couldn't execute query.");
} ELSE IF (@$action == "addnew"){
$connection2 = @mysql_connect("localhost", "USERNAME", "PASSWORD") or die("couldn't connect");
$db2 = @mysql_select_db("DATABASENAME", $connection2) or die("couldn't select database.");
$sql2 = "INSERT INTO 2ndstreetEvents (ID, Date, Event, Description) VALUES (\"\", \"$Date\", \"".ereg_replace(" "," ",nl2br(htmlentities($Event)))."\", \"".ereg_replace(" "," ",nl2br(htmlentities($Description)))."\")";
$result2 = @($sql2, $connection2) or die("couldn't execute query.");
}
?>
Any ideas? I can give a link to the exact pages if needed.
Thanks,
Chris