want to add a break after a certain amount of characters


Posted on 16th Feb 2014 07:03 pm by admin

i was wondering how to add a break in a blog post after a certain amount of characters... any idea on how to do this???

this is the code i'm workig with

<?php

$connect = mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("blog", $connect) or die(mysql_error());

echo "<h1>Blog</h1>";

$query = mysql_query("SELECT * FROM blog");

if (mysql_num_rows($query) == 0) {
echo "<hr />There are no posts yet, make the first in the admin section!";
} else {
while ($row = mysql_fetch_assoc($query)) {
echo "<hr />";
$title2 = $row['title'];
$name = $row['name'];
$email = $row['email'];
$post = $row['post'];
$date = $row['date'];
$time = $row['time'];

echo "<h3>Title: " . $title2 . "</h3><table width='100%'><tr><td><b>Posted by: " . $name . "(" . $email . ") at " . $time . " on " . $date . "</b></td></tr><tr><td>" . nl2br(strip_tags($post)) . "</td></tr></table>n";
}
}

echo "<hr />";

$page = $_GET['p'];
if ($page) {
$path = "/inc/" . $page . ".php";
if (file_exists($path)) {
include ($path);
}
}

echo "Are you an admin? <a href='index.php?p=blog&p=credentials'>Place a post</a>";

?>

No comments posted yet

Your Answer:

Login to answer
117 Like 36 Dislike
Previous forums Next forums
Other forums

Whats wrong with my query?
I am trying to get this query to show the appropriate ticked vehicle roof height, unless no boxs are

Deleted Delivery but material wont return
We deleted a delivery but the material its still pending.

We made a reverse goods movemen

What do you call the "token" thing?
You know how some sites have links that run on tokens? Tokens are links that only stay alive for a c

WM transfer order: confirm different batch than proposed by system
Hi folks,

following scenario: we have a full WM with mixed batch numbers allowed in stora

Parse error: syntax error, unexpected $end in
hello,
i receive the error :Parse error: syntax error, unexpected $end in C:xamppxampphtdocsh

How to get all server headers like Live http Headers does
Hey all, like many of you I use the Firefox addon "Live http Headers". I'm trying to write

Include with Parameters
In a particular page I would like to include a file that requires $_GET parameters.

when I go

form submit at godaddy?
Trying to test form submission at GoDaddy and it does not seem to work. Here's the page...

h

Weird MySQL error, why am I recieving this?
PHP Code:


<?php require "global_settings.php"; ?>
<titl

my code does not work.
I have a code problem.

Quote"<a href=index.php?gogo=ureticidetay&'?l={$le

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash