php - using nl2br after decrypting a record in a mySQL Database -
in past, when want display text-content (textarea -> mysql database) in html, used nl2br display content correctly in html.
now want after decrypting database-content, doens´t work.
$note = openssl_decrypt($note, "aes-256-cbc", "$encode_key", 0 , "$encode_key"); $outputnote = str_replace("\r\n", "test", "$note"); echo $outputnote;
what´s wrong in solution?
ok. thats full code generating note
$sql_notes = "select content gn_notes userid = '$sessionid' order tstamp desc"; $result = mysqli_query($db_link, $sql_notes); $number=mysqli_num_rows($result); if($number > 0) { while ($record = mysqli_fetch_assoc($result)) { $date = date("d.m.y", $record['tstamp']); $time = date("h:i", $record['tstamp']); $note = $record['content']; /* looking encode_key */ $encode_key = getvalue('encode_key', 'gn_user', $sessionid, $db_link); $note = openssl_decrypt($note, "aes-256-cbc", "$encode_key", 0 , "$encode_key"); echo nl2br($note); } }
that output in website: screenshot ouput
Comments
Post a Comment