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
Did you know?Explore Trending and Topic pages for more stories like this.
<?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
36
Other forums
Restricted access to sub-folder in iis6 doesn't work?
Basically I'm trying to add restriction to sub-folder (which contains pdf) in web.config for iis6 as
Perplexing problem showing a .jpg
Please disregard..........I figured it out
temporary objects
Until now i thought every temporary object in C++ is created as constant. I'm wondering why my compi
MII Trends - add data onto chart object
Hello,
Can anyone please provide some thoughts on my current requirement:
its pretty
update the selected existing records of database
Hi frndz,
I am new to php and get stuck....
Edit.php > Update.php > Updatea
Cant display mysql data
Hey all,
I am learning php and my first goal is to create a simple CMS. At the moment I am st
LIMIT $start, 10... how to pass last value queried into next page with GET??
Ok I know how to display the first or last 10 results of a query...
$result = mysql_query(&q
upload photo limits
ive got a upload photo script and im just trying to make more secure currently it limits size and as
DBCA Templates
Hi all,
I'm working on creating a template for DBCA, but can't find any documentation on the
Need help with simple code, back and forward buttons.
Basically, I have a set of pages in a folder, which have the title somephrasehere_09.php, somephrase