Aftermath Posted May 18, 2006 Share Posted May 18, 2006 ** I commented the line:[code]$entry = nl2br($entry);[/code]out and when i changed it back it started working... Can php be picky like that?Hello all. I have been working on a blog type site and I have encountered an issue. Whenever I try to create a post that has a line break in it, it says the data was succesful entered into the table but when I try to display it, it will only display text until the first linebreak. I am unsure if this is a php or mysql problem, but the following code is my script to insert the info into the table.[code]<?phpif (isset($_POST['submit'])) { $title = htmlspecialchars(strip_tags($_POST['title'])); $entry = $_POST['entry']; $username = $_POST['username']; $timestamp = strtotime($current_month . " " . $current_date . " " . $current_year); $entry = nl2br($entry); mysql_connect ('localhost', '******', '******'); mysql_select_db ('******'); $sql = "INSERT INTO post_table (timestamp,username,title,entry) VALUES ('$timestamp','$username','$title','$entry')"; $result = mysql_query($sql) or print("Error!.<br />" . $sql . "<br />" . mysql_error()); if ($result != false) { print "Your entry has successfully been entered!"; }}if (isset($_POST['edit'])) { $idnum = $_POST['idnum']; header("Location:update.php?id=" . $idnum); } mysql_close();?>[/code] Link to comment https://forums.phpfreaks.com/topic/9952-linebreaks-in-a-post/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.