glassfish Posted October 4, 2014 Share Posted October 4, 2014 This is my code: The Form: <div class="tcn02"> <H1>You are Writing this Post</H1> <form action="insert.php" method="POST"> <input class="input_title" type="text" name="title" /> <br /> <textarea id="editor1" type="text" name="post"></textarea> <br /> <input type="submit" name="submit" /> </form> </div> The Query: <?php $title = $_POST['title']; $post = $_POST['post']; echo "<div class='tcn02'>"; # The Query String $tqs = "INSERT INTO ttn02 (title, post, date_created) VALUES ('$title', '$post', now())"; # The Query Run $tqr = mysqli_query($dbc, $tqs) or die(mysqli_error($dbc)); echo "The data has gotten successfully added."; echo "</div>"; ?> When I try to store code which I am looking to print inside pre tags, then the code gets cut off. I have tried to store the form from above into the database. Each time it gets cut off like shown in the example This is how it gets stored into the database: <p>The Code:</p> <pre> <<strong>div </strong><strong>class=</strong><strong>"tcn02"</strong>> <<strong>H1</strong>>You are Writing this Post</<strong>H1</strong>> <<strong>form </strong><strong>action=</strong><strong>"insert.php" </strong><strong>method=</strong><strong>"POST"</strong>> <<strong>input </strong><strong>class=</strong><strong>"input_title" </strong><strong>type=</strong><strong This is how it looks like when printing it: <div class="tcn02"> <H1>You are Writing this Post</H1> <form action="insert.php" method="POST"> <input class="input_title" type= What could be the problem here? Link to comment https://forums.phpfreaks.com/topic/291442-code-in-pre-tags-cuts-off/ Share on other sites More sharing options...
jcbones Posted October 4, 2014 Share Posted October 4, 2014 Looks to be truncated by the database, due to column size constraints. You would need to look at your database table structure for that. Link to comment https://forums.phpfreaks.com/topic/291442-code-in-pre-tags-cuts-off/#findComment-1492745 Share on other sites More sharing options...
glassfish Posted October 4, 2014 Author Share Posted October 4, 2014 Ohh man, I totally missed that. I apologize for this mistake. It is working now. Link to comment https://forums.phpfreaks.com/topic/291442-code-in-pre-tags-cuts-off/#findComment-1492747 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.