In: Fonts
18 Jun 20101. ABC - Font
2. Advent Font:
3. Bolts Font
4. Comfortaa - Font:
5. Coreldraw
6.Denne Marker:
7. Drot_Sans
8. Evolution True Type Font
9. Fonce Sans Regular
10. VINEGAR
11. Geline font
12. Illegal Curves
13. K R A K E N - B E T A
14. Kaifo font
15. MDRS
16. Quarters Font
17. Regenerate Font
18. Surrounding
19. Rounded
http://mocon.deviantart.com/art/Rounded-158474463?q=favby%3Aawesome-fonts%
2F39159239&qo=95
20. Thurston the Font
21. Consume or Die

In: JQUERY
16 Jun 20101. sohtanaka
2. Chapagain
3. Realistic Hover Effect
4. PaperMashup
5. MattBango
6. Queness
7. Andreaslagerkvist
8. Zoomer Gallery
9. Tympanus
10. tympanus
In: PHP
24 Feb 2010An array is a data structure that stores one or more values in a single value. A variable can store only one data in memory. When we need to store more than one values we use Array to store data. Array understand data by its index. It’s a collection of elements having same name but different index.
In: JavaScript
8 Feb 2010Today I am going to show some simple JavaScripts Which will allow user to enter only number in a textfield of your form. It will help you to restrict entering any other character besides numbers inside the text input field. The First Method allow you to validate a phone number which will allow user to input numbers from 0-9 and characters “+()-”.
First Method:
The Script
<script language="javascript">function forceNumber(event){
var keyCode = event.keyCode ? event.keyCode : event.charCode;if((keyCode < 48 || keyCode > 58) && keyCode != 8 && keyCode != 9 && keyCode != 32 && keyCode != 37 && keyCode != 39 && keyCode != 40 && keyCode != 41 && keyCode != 43 && keyCode != 45 && keyCode != 46)return false;}
</script>
In: PHP
16 Jan 2010“This tutorial is very best for OOP beginners. I found it’s very best. I think it will help all beginners who want to start OOP.”
by Kevin Waterson
Contents
In: PHP
31 Dec 2009Login System is the First Part of Security system in web programming. In this tutorial I am going to show you the collection of various methos and types of login system. I will give a right choice for your system and you can understand more about login.
1. Making A Cool Login System With PHP, MySQL & jQuery
2. Ajax login validation system in PHP using jQuery
3. PHP Login System with Admin Features By evolt org
4. Php Login System – Login Management and Login Control Tutorial
5. How To Make a Login System for Your Website
6. Complete advanced login member system – PHP tutorial
In: Templates
27 Dec 20091. Joomla24
2. Free Joomla Templates
3. Site Ground
4. Themza

5. Free Joomla Templates
6. Template Monster
7. Joomla Mania
8. JoomlaShack
9. JoomlaDesigns
10. dezinedepot
11. Joomla Shine
12. Best Free Joomla Templates
13. Themebase
14. Best of Joomla
15. Joomla Xtreme
“CodeIgniter is a powerful PHP framework with a very small footprint, built for PHP coders who need a simple and elegant toolkit to create full-featured web applications. If you’re a developer who lives in the real world of shared hosting accounts and clients with deadlines, and if you’re tired of ponderously large and thoroughly undocumented frameworks”
CodeIgniter is an open source web application framework for use in building dynamic web sites with PHP.

1. Download And Install CodeIgniter in your local system:

a. Download the latest Version of CodeIgniter and Unzip it in your root.
b. Move your folder to your www folder. (I am using xampp so I move it in my xampp root.)
c. To check out your CodeIgniter just type: http://localhost/CodeIgniter_1.7.2/
d. You can rename your CodeIgniter as your application Like if I am going to create a blog I will rename CodeIgniter_1.7.2 to blog.
e.
In your system/application/config directory you can change base url like :
$config['base_url'] = “http://localhost/blog/”;
f. To work with database open databse.php file from system/application/config/ and chage to your settings.
$db['default']['hostname'] = “localhost”;$db['default']['username'] = “root”;
$db['default']['password'] = “jagadish”;
$db['default']['database'] = “blog”;
$db['default']['dbdriver'] = “mysql”;
$db['default']['dbprefix'] = “”;
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = “”;
$db['default']['char_set'] = “utf8″;
$db['default']['dbcollat'] = “utf8_general_ci”;
Now Test your Blog http://localhost/blog/ You will see the below screen if your system have problem..

2.Understanding MCV:
MVC is stands for Model View Controllers.
MODEL
Models are PHP classes that are designed to work with information in your database.
The Model represents your data structures. Typically your model classes will contain functions that help you retrieve, insert, and update information in your database.
VIEW
A view is simply a web page, or a page fragment, like a header, footer, sidebar, etc. In fact, views can flexibly be embedded within other views (within other views, etc., etc.) if you need this type of hierarchy. Views are never called directly. So in the above screen you can see there is a controller page welcome.php in system/application/controllers/welcome.php.
CONTROLLER
“A Controller is simply a class file that is named in a way that can be associated with a URI.” You have to understand that when a controller’s name matches the first segment of a URI, it will be loaded.
3. Understanding Page:
In the above picture of screen you can see the message URI system/application/views/welcome_message.php. That is the page which you currently seeing. Which have controller file in system/application/controllers/welcom.php.
4. Creating a Simple Page in CodeIgniter
Let me to start with controller page. Here I create a page blog.php. Copy the code below and paste in your text editor save it in system/application/controllers/
<?phpclass Blog extends Controller {
function index()
{
$tutorial['my_tutorial'] = array(’Download CodeIgniter’, ‘Install in Local Machine’, ‘Understand MVC’, ‘Create your First Application’);
$tutorial['title'] = “CodeIgniter Tutorial”;
$tutorial['heading'] = “You Will Know”;
$this->load->view(’blogpage’, $tutorial);
}
}
?>
And now create another file blogpage and save it in system\application\views.
<html><head>
<title><?php echo $title;?></title>
</head>
<body>
<h2><?php echo $heading;?></h2>
<p><strong>My Todo List</strong></p>
<ul>
<?php foreach($my_tutorial as $item):?>
<li><?php echo $item;?></li>
<?php endforeach;?>
</ul>
</body>
</html>
Ok Now Test your first Program that should be http://localhost/blog/index.php/blog

In: CSS
16 Dec 2009Previously I have written a full text page having Complete Tutorial For Developing own CMS System. On the request of my readers I am going to post the CSS style for the code.
@charset "utf-8";
/* CSS Document */body{
margin:0;
padding:0;
font: 11px "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
}
.sitetitle{
padding:0px 0px 0px 25px;
font-family: "Arial";
display: inline;
color: white;
font-size: 24px;
font-weight: bold;
vertical-align: middle;
}
.dispaly{
border:1px solid #8c8c8c;
}
.menu{
padding:3px 5px 3px 10px;
color:#0099CC;
font-weight:bold;
font-size:12px;
text-decoration:none;
}
.menu a{
padding:3px 5px 3px 10px;
color:#0099CC;
font-weight:bold;
font-size:12px;
text-decoration:none;
}
h1{
font-size:16px;
color:#006699;
padding-top:10px;
text-decoration:none;
}
h1 span{
font-size:10px;
color:#999999;
text-align:right;
padding-right:0px 20px 0px 30px;
font-weight:normal;
}
h1 a{
font-size:16px;
color:#0099CC;
padding-top:10px;
text-decoration:none;
}
.posted{
font-size:10px;
color:#999999;
text-align:right;
font-weight:normal;
}
.archtitle{
font-size:12px;
font-weight:bold;
color:#FFFFFF;
text-align:center;
}
.menupost{
font-size:11px;
color:#FFFFFF;
text-decoration:none;
}
.menupost a{
font-size:11px;
color:#FFFFFF;
text-decoration:none;
}.footertext{
padding:0px 10px 0px 10px;
text-align:center;
color:#FFFFFF;
font-size:12px;
}
.footertext a{
text-align:center;
color:#FFFFFF;
font-size:12px;
text-decoration:none;
}
You can Download Zip file Here
In: PHP
11 Nov 2009In this tutorial I am going to show you how you can develop a simple CMS (Content Management System) in a very quick and easy way. In this tutorial I have used table for layout. You can use your CSS style for develop your CMS.
Let’s begain with Database.
Create Database CMS for your CMS site
Copy and paste the following query to create quick tables. Or you can create your own as you wish.
CREATE TABLE `siteconfig` (
`id` int(11) NOT NULL auto_increment,
`cmstitle` varchar(200) collate latin1_general_ci NOT NULL,
`version` varchar(50) collate latin1_general_ci NOT NULL,
`copyinfo` varchar(200) collate latin1_general_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM
INSERT INTO `siteconfig` (`id`, `cmstitle`, `version`, `copyinfo`) VALUES
(1, 'Jagadishwor''s Simple CMS System', 'Version 1.0', 'Copyright © <a href="http://www.jagadishwor.com.np">Jagadishwor.com.np</a> 2009');
CREATE TABLE `tblcategory` (
`catid` int(11) NOT NULL auto_increment,
`catname` varchar(100) collate latin1_general_ci NOT NULL,
PRIMARY KEY (`catid`)
) ENGINE=MyISAM
INSERT INTO `tblcategory` (`catid`, `catname`) VALUES
(1, 'AJAX'),
(3, 'MYSQL'),
(4, 'Wordpress'),
(5, 'CSS');
CREATE TABLE `tblpost` (
`postid` int(11) NOT NULL auto_increment,
`heading` varchar(250) collate latin1_general_ci NOT NULL,
`article` longtext collate latin1_general_ci NOT NULL,
`postdate` date NOT NULL,
`postby` varchar(200) collate latin1_general_ci NOT NULL,
`catid` int(11) NOT NULL,
`posttag` varchar(100) collate latin1_general_ci NOT NULL,
`status` int(1) NOT NULL,
PRIMARY KEY (`postid`)
) ENGINE=MyISAM
Now We will start to develop our Content Management System

Before we start we will discuss about the layout and pages.
In this tutorial I am going to develop pages like this:
header.php
menu.php
archieves.php
index.php
footer.php
sidebar.php
category.php
result.php
article.php
style.css
include/constr.php
include/definer.php
Create a database connection string inside include folder:
<?php
$db_host = "localhost";
$db_user = "root";//Change to your mysql user
$db_pass = ""; // Change to your mysql password
$db_name = "cms";
mysql_connect($db_host, $db_user, $db_pass) or die(mysql_error());
mysql_select_db($db_name);
?>
Now I am going to define some value for our CMS like title, copyinfo and version in definer. I will update it in my comming system. Create definer.php inside your include folder and paste the code:
<?php
$query='SELECT * from siteconfig';
$result=mysql_query($query);
if(!$result){
die('No Title Found For This Page because '. mysql_error());
}else{
$row=mysql_fetch_array($result);
$title=$row['cmstitle'];
$version=$row['version'];
$copyright=$row['copyinfo'];
}
?>
Create a new php file name it index.php and save it in your root.
<?php include 'header.php';?>
<tr>
<td colspan="2"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="dispaly">
<tr>
<td><table width="96%" border="0" cellspacing="0" cellpadding="0" align="center">
<?php
$rowsPerPage = 7;
$pageNum = 1;
if(isset($_GET['page']))
{
$pageNum = $_GET['page'];
}
$offset = ($pageNum - 1) * $rowsPerPage;
$qry="SELECT a.*, b.catname FROM `tblpost` a, `tblcategory` b WHERE a.catid=b.catid ORDER BY a.postid DESC LIMIT $offset, $rowsPerPage";
$result=mysql_query($qry);
while($row=mysql_fetch_array($result)){
?>
<tr>
<td><h1><a href="article.php?id=<?php echo $row['postid'];?>"><?php echo $row['heading'];?></a><span> »<?php echo $row['postdate'];?></span></h1></td>
</tr>
<tr>
<td><span class="posted"><strong>Posted By: </strong><em><?php echo $row['postby'];?></em> »<strong>Under Category: </strong><em><?php echo $row['catname'];?></em> »<strong>Under Tag: </strong><em><?php echo $row['posttag'];?></em></span></td>
</tr>
<tr>
<td><?php echo substr(str_replace("\r\n","<br>",$row['article']),0,400)." <a href='article.php?id=$row[postid]'>Read More...</a>";?></td>
</tr>
<tr>
<td></td>
</tr>
<?php
}
?>
<tr>
<td><center>
<?php
$query = "SELECT COUNT(postid) AS numrows FROM tblpost";
$result = mysql_query($query) or die('Error, query failed');
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$numrows = $row['numrows'];
$maxPage = ceil($numrows/$rowsPerPage);
$self = $_SERVER['PHP_SELF'];
$nav = '';
for($page = 1; $page <= $maxPage; $page++)
{
if ($page == $pageNum)
{
$nav .= " $page "; // no need to create a link to current page
}
else
{
$nav .= " <a href=\"$self?action=view-news&page=$page\">$page</a> ";
}
}
if ($pageNum > 1)
{
$page = $pageNum - 1;
$prev = " <a href=\"$self?action=view-news&page=$page\">[Prev]</a> ";
$first = " <a href=\"$self?action=view-news&page=1\">[First Page]</a> ";
}
else
{
$prev = ' '; // we're on page one, don't print previous link
$first = ' '; // nor the first page link
}
if ($pageNum < $maxPage)
{
$page = $pageNum + 1;
$next = " <a href=\"$self?action=view-news&page=$page\">[Next]</a> ";
$last = " <a href=\"$self?action=view-news&page=$maxPage\">[Last Page]</a> ";
}
else
{
$next = ' '; // we're on the last page, don't print next link
$last = ' '; // nor the last page link
}
// print the navigation link
echo $prev . $nav . $next."<br>";
echo "Page $pageNum of $maxPage";
// and close the database connection
?></center>
</td>
</tr>
</table></td>
</tr>
</table></td>
<td width="24%" bgcolor="#8c8c8c" valign="top" align="center"><?php include 'sidebar.php';?></td>
</tr>
<?php include 'footer.php';?>
</table></td>
</tr>
</table>
</body>
</html>
Paste code for your header.php file under your root folder.
<?php include 'include/constr.php';?>
<?php include 'include/definer.php';?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title><?php echo $title;?></title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr bgcolor="#464646">
<td height="90" colspan="3"><span class="sitetitle"><?php echo $title;?></span></td>
</tr>
<tr>
<td colspan="3"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="76%" height="35"><span class="menu"><?php echo $home="<a href='index.php'> Home </a> | ";?><?php include 'menu.php';?></span></td>
<td width="24%" valign="middle"><form name="form1" method="post" action="result.php">
Search
<input name="search" type="text" id="search" size="20">
<input type="submit" name="Submit" value="Go">
</form></td>
</tr>
</table></td>
</tr>
Create footer.php in the same location
<tr>
<td colspan="3"> </td>
</tr>
<tr bgcolor="#6d6d6d">
<td width="33%" height="40"><span class="footertext"><?php echo $copyright;?></span></td>
<td width="43%"> </td>
<td><span class="footertext"><em><?php echo $version;?></em></span></td>
</tr>
Create sidebar.php in the root directory and paste code
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30" bgcolor="#4d4d4d"><span class="archtitle">Archieve</span></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<?php
$query="SELECT MONTH(postdate) MONTH, MONTHNAME(postdate)MONTHNAME, YEAR(postdate)year FROM tblpost GROUP BY MONTH(postdate) , YEAR(postdate) ORDER BY postdate";
$result=mysql_query($query);
while($row=mysql_fetch_array($result)){
?>
<tr>
<td bgcolor="#FFFFFF" height="2px"></td>
</tr>
<tr>
<td height="20"><span class="menupost"><a href="archieves.php?month=<?php echo $row['MONTH'];?>&year=<?php echo $row['year'];?>"><?php echo $row['MONTHNAME']."-". $row['year'];?></a></span></td>
</tr>
<?php
}
?>
</table></td>
</tr>
<tr>
<td height="30" bgcolor="#4d4d4d"><span class="archtitle">Recent Post</span></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td></td>
</tr>
<?php
$query="SELECT postid, heading, article FROM tblpost ORDER BY postid DESC LIMIT 0,10";
$result=mysql_query($query);
while($row=mysql_fetch_array($result)){
?>
<tr>
<td bgcolor="#FFFFFF" height="2px"></td>
</tr>
<tr>
<td align="left"><span class="menupost">» <a href="article.php?id=<?php echo $row['postid'];?>"><strong><?php echo $row['heading'];?>: </strong><?php echo substr($row['article'], 0, 40)." ...";?></a></span></td>
</tr>
<?php
}
?>
</table></td>
</tr>
</table>
To display menu create menu.php in your root and paste the code
<?php
$qry="SELECT * FROM tblcategory ORDER BY catid ASC";
$result=mysql_query($qry);
while($row=mysql_fetch_array($result)){
echo "<a href='category.php?catid=$row[catid]'>".$row['catname']."</a>". " | ";
}
?>
We complete our index page and now you can test your index page. For more option we will develop four more pages which will display content on the basis of articles (Full article), archieves, search result and category.
Now first create article.php page and paste the following code
<?php include 'header.php';?>
<tr>
<td colspan="2"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="dispaly">
<tr>
<td><table width="96%" border="0" cellspacing="0" cellpadding="0" align="center">
<?php
if(isset($_GET['id'])){
$id=$_GET['id'];
if($id!=""){
$qry="SELECT a.*, b.catname FROM `tblpost` a, `tblcategory` b WHERE a.catid=b.catid and a.postid='$id'";
$result=mysql_query($qry);
if(mysql_num_rows($result)<1){
echo "Sorry No post found!";
}
while($row=mysql_fetch_array($result)){
?>
<tr>
<td><h1><a href="article.php?id=<?php echo $row['postid'];?>"><?php echo $row['heading'];?></a><span> »<?php echo $row['postdate'];?></span></h1></td>
</tr>
<tr>
<td><span class="posted"><strong>Posted By: </strong><em><?php echo $row['postby'];?></em> »<strong>Under Category: </strong><em><?php echo $row['catname'];?></em> »<strong>Under Tag: </strong><em><?php echo $row['posttag'];?></em></span></td>
</tr>
<tr>
<td><?php echo str_replace("\r\n","<br>",$row['article']);?></td>
</tr>
<tr>
<td></td>
</tr>
<?php
}
?>
<tr>
<td>
<?php
}
}
?>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table></td>
</tr>
</table></td>
<td width="24%" bgcolor="#8c8c8c" valign="top" align="center"><?php include 'sidebar.php';?></td>
</tr>
<?php include 'footer.php';?>
</table></td>
</tr>
</table>
</body>
</html>
Create category.php page and paste code
<?php include 'header.php';?>
<tr>
<td colspan="2"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="dispaly">
<tr>
<td><table width="96%" border="0" cellspacing="0" cellpadding="0" align="center">
<?php
$catid=$_GET['catid'];
$rowsPerPage = 7;
$pageNum = 1;
if(isset($_GET['page']))
{
$pageNum = $_GET['page'];
}
$offset = ($pageNum - 1) * $rowsPerPage;
$qry="SELECT a.*, b.catname FROM `tblpost` a, `tblcategory` b WHERE a.catid=b.catid and a.catid='$catid' ORDER BY a.postid DESC LIMIT $offset, $rowsPerPage";
$result=mysql_query($qry);
if(mysql_num_rows($result)<1){
echo "Sorry No post found!";
}
while($row=mysql_fetch_array($result)){
?>
<tr>
<td><h1><a href="article.php?id=<?php echo $row['postid'];?>"><?php echo $row['heading'];?></a><span> »<?php echo $row['postdate'];?></span></h1></td>
</tr>
<tr>
<td><span class="posted"><strong>Posted By: </strong><em><?php echo $row['postby'];?></em> »<strong>Under Category: </strong><em><?php echo $row['catname'];?></em> »<strong>Under Tag: </strong><em><?php echo $row['posttag'];?></em></span></td>
</tr>
<tr>
<td><?php echo substr(str_replace("\r\n","<br>",$row['article']),0,400)." <a href='article.php?id=$row[postid]'>Read More...</a>";?></td>
</tr>
<tr>
<td></td>
</tr>
<?php
}
?>
<tr>
<td><center>
<?php
$query = "SELECT COUNT(postid) AS numrows FROM tblpost";
$result = mysql_query($query) or die('Error, query failed');
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$numrows = $row['numrows'];
$maxPage = ceil($numrows/$rowsPerPage);
$self = $_SERVER['PHP_SELF'];
$nav = '';
for($page = 1; $page <= $maxPage; $page++)
{
if ($page == $pageNum)
{
$nav .= " $page "; // no need to create a link to current page
}
else
{
$nav .= " <a href=\"$self?action=view-news&page=$page\">$page</a> ";
}
}
if ($pageNum > 1)
{
$page = $pageNum - 1;
$prev = " <a href=\"$self?action=view-news&page=$page\">[Prev]</a> ";
$first = " <a href=\"$self?action=view-news&page=1\">[First Page]</a> ";
}
else
{
$prev = ' '; // we're on page one, don't print previous link
$first = ' '; // nor the first page link
}
if ($pageNum < $maxPage)
{
$page = $pageNum + 1;
$next = " <a href=\"$self?action=view-news&page=$page\">[Next]</a> ";
$last = " <a href=\"$self?action=view-news&page=$maxPage\">[Last Page]</a> ";
}
else
{
$next = ' '; // we're on the last page, don't print next link
$last = ' '; // nor the last page link
}
// print the navigation link
echo $prev . $nav . $next."<br>";
echo "Page $pageNum of $maxPage";
// and close the database connection
?></center>
</td>
</tr>
</table></td>
</tr>
</table></td>
<td width="24%" bgcolor="#8c8c8c" valign="top" align="center"><?php include 'sidebar.php';?></td>
</tr>
<?php include 'footer.php';?>
</table></td>
</tr>
</table>
</body>
</html>
Now create archieves.php page to show archieve list.
<?php include 'header.php';?>
<tr>
<td colspan="2"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="dispaly">
<tr>
<td><table width="96%" border="0" cellspacing="0" cellpadding="0" align="center">
<?php
$month=$_GET['month'];
$year=$_GET['year'];
$date=$year."-".$month;
$rowsPerPage = 7;
$pageNum = 1;
if(isset($_GET['page']))
{
$pageNum = $_GET['page'];
}
$offset = ($pageNum - 1) * $rowsPerPage;
$qry="SELECT a.*, b.catname FROM `tblpost` a, `tblcategory` b WHERE a.catid=b.catid and MONTH(a.postdate)='$month' and YEAR(a.postdate)='$year' ORDER BY a.postdate DESC LIMIT $offset, $rowsPerPage";
$result=mysql_query($qry);
if(mysql_num_rows($result)<1){
echo "Sorry No post found!";
}
while($row=mysql_fetch_array($result)){
?>
<tr>
<td><h1><a href="article.php?id=<?php echo $row['postid'];?>"><?php echo $row['heading'];?></a><span> »<?php echo $row['postdate'];?></span></h1></td>
</tr>
<tr>
<td><span class="posted"><strong>Posted By: </strong><em><?php echo $row['postby'];?></em> »<strong>Under Category: </strong><em><?php echo $row['catname'];?></em> »<strong>Under Tag: </strong><em><?php echo $row['posttag'];?></em></span></td>
</tr>
<tr>
<td><?php echo substr(str_replace("\r\n","<br>",$row['article']),0,400)." <a href='article.php?id=$row[postid]'>Read More...</a>";?></td>
</tr>
<tr>
<td></td>
</tr>
<?php
}
?>
<tr>
<td><center>
<?php
$query = "SELECT COUNT(postid) AS numrows FROM tblpost";
$result = mysql_query($query) or die('Error, query failed');
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$numrows = $row['numrows'];
$maxPage = ceil($numrows/$rowsPerPage);
$self = $_SERVER['PHP_SELF'];
$nav = '';
for($page = 1; $page <= $maxPage; $page++)
{
if ($page == $pageNum)
{
$nav .= " $page "; // no need to create a link to current page
}
else
{
$nav .= " <a href=\"$self?action=view-news&page=$page\">$page</a> ";
}
}
if ($pageNum > 1)
{
$page = $pageNum - 1;
$prev = " <a href=\"$self?action=view-news&page=$page\">[Prev]</a> ";
$first = " <a href=\"$self?action=view-news&page=1\">[First Page]</a> ";
}
else
{
$prev = ' '; // we're on page one, don't print previous link
$first = ' '; // nor the first page link
}
if ($pageNum < $maxPage)
{
$page = $pageNum + 1;
$next = " <a href=\"$self?action=view-news&page=$page\">[Next]</a> ";
$last = " <a href=\"$self?action=view-news&page=$maxPage\">[Last Page]</a> ";
}
else
{
$next = ' '; // we're on the last page, don't print next link
$last = ' '; // nor the last page link
}
// print the navigation link
echo $prev . $nav . $next."<br>";
echo "Page $pageNum of $maxPage";
// and close the database connection
?></center>
</td>
</tr>
</table></td>
</tr>
</table></td>
<td width="24%" bgcolor="#8c8c8c" valign="top" align="center"><?php include 'sidebar.php';?></td>
</tr>
<?php include 'footer.php';?>
</table></td>
</tr>
</table>
</body>
</html>
Now create page for search result, result.php
<?php include 'header.php';?>
<tr>
<td colspan="2"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="dispaly">
<tr>
<td><table width="96%" border="0" cellspacing="0" cellpadding="0" align="center">
<?php
if(isset($_POST['search'])){
$search=$_POST['search'];
}
$rowsPerPage = 7;
$pageNum = 1;
if(isset($_GET['page']))
{
$pageNum = $_GET['page'];
}
$offset = ($pageNum - 1) * $rowsPerPage;
$qry="SELECT * FROM `tblpost` WHERE heading like '%$search%' or posttag like '%$search%'ORDER BY postid DESC LIMIT $offset, $rowsPerPage";
$result=mysql_query($qry);
if(mysql_num_rows($result)<1){
echo "Sorry No post found for your search!";
}
while($row=mysql_fetch_array($result)){
?>
<tr>
<td><h1><a href="article.php?id=<?php echo $row['postid'];?>"><?php echo $row['heading'];?></a><span> »<?php echo $row['postdate'];?></span></h1></td>
</tr>
<tr>
<td><span class="posted"><strong>Posted By: </strong><em><?php echo $row['postby'];?></em> »<strong>Under Category: </strong><em><?php
$sql="SELECT catname from tblcategory WHERE catid=$row[catid]";
$res=mysql_query($sql);
$rowcat=mysql_fetch_array($res);
$catname=$rowcat['catname'];
echo $catname;
?></em> »<strong>Under Tag: </strong><em><?php echo $row['posttag'];?></em></span></td>
</tr>
<tr>
<td><?php echo substr(str_replace("\r\n","<br>",$row['article']),0,400)." <a href='article.php?id=$row[postid]'>Read More...</a>";?></td>
</tr>
<tr>
<td></td>
</tr>
<?php
}
?>
<tr>
<td><center>
<?php
$query = "SELECT COUNT(postid) AS numrows FROM tblpost";
$result = mysql_query($query) or die('Error, query failed');
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$numrows = $row['numrows'];
$maxPage = ceil($numrows/$rowsPerPage);
$self = $_SERVER['PHP_SELF'];
$nav = '';
for($page = 1; $page <= $maxPage; $page++)
{
if ($page == $pageNum)
{
$nav .= " $page "; // no need to create a link to current page
}
else
{
$nav .= " <a href=\"$self?action=view-news&page=$page\">$page</a> ";
}
}
if ($pageNum > 1)
{
$page = $pageNum - 1;
$prev = " <a href=\"$self?action=view-news&page=$page\">[Prev]</a> ";
$first = " <a href=\"$self?action=view-news&page=1\">[First Page]</a> ";
}
else
{
$prev = ' '; // we're on page one, don't print previous link
$first = ' '; // nor the first page link
}
if ($pageNum < $maxPage)
{
$page = $pageNum + 1;
$next = " <a href=\"$self?action=view-news&page=$page\">[Next]</a> ";
$last = " <a href=\"$self?action=view-news&page=$maxPage\">[Last Page]</a> ";
}
else
{
$next = ' '; // we're on the last page, don't print next link
$last = ' '; // nor the last page link
}
// print the navigation link
echo $prev . $nav . $next."<br>";
echo "Page $pageNum of $maxPage";
// and close the database connection
?></center>
</td>
</tr>
</table></td>
</tr>
</table></td>
<td width="24%" bgcolor="#8c8c8c" valign="top" align="center"><?php include 'sidebar.php';?></td>
</tr>
<?php include 'footer.php';?>
</table></td>
</tr>
</table>
</body>
</html>
OK our CMS for client side have been completed. Now create admin section for post articles and add category. Create folder admin in your root.

Now create a index.php file inside your root and paste the following code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Jagadishwor's Simple CMS System</title>
<link href="../style.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr bgcolor="#464646">
<td height="90" colspan="2" bgcolor="#464646"><span class="sitetitle">Jagadishwor's Simple CMS System</span></td>
<td height="90"> </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr> <tr>
<td colspan="2"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="dispaly">
<tr>
<td><form name="form1" method="post" action="">
<table width="96%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><h1><a href="article.php?id=1">Welcome admin Please click on the menu for your work. </a><span> </span></h1></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td><center>
</center></td>
</tr>
</table>
</form></td>
</tr>
</table></td>
<td width="24%" bgcolor="#8c8c8c" valign="top" align="center"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30" bgcolor="#4d4d4d"><span class="archtitle">Admin Menu </span></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#FFFFFF" height="2px"></td>
</tr>
<tr>
<td height="20"><span class="menupost"><a href="addnew.php">Add New Post </a></span></td>
</tr>
<tr>
<td height="2" bgcolor="#ffffff"></td>
</tr>
<tr>
<td height="20"><a href="viewpost.php" class="menupost">View Post </a></td>
</tr>
<tr>
<td height="2" bgcolor="#ffffff"></td>
</tr>
<tr>
<td height="20"><a href="addcategory.php" class="menupost">Add New Category </a></td>
</tr>
<tr>
<td height="2" bgcolor="#ffffff"></td>
</tr>
<tr>
<td height="2" bgcolor="#ffffff"></td>
</tr>
</table></td>
</tr>
<tr>
<td height="30" bgcolor="#4d4d4d"> </td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td></td>
</tr>
<tr>
<td bgcolor="#FFFFFF" height="2px"></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr bgcolor="#6d6d6d">
<td width="33%" height="40"><span class="footertext">Copyright © <a href="http://www.jagadishwor.com.np">Jagadishwor.com.np</a> 2009</span></td>
<td width="43%"> </td>
<td><span class="footertext"><em>Version 1.0</em></span></td>
</tr> </table></td>
</tr>
</table>
</body>
</html>
To add New post contents let’s add a new file addnew.php
<?php include '../include/constr.php';?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Jagadishwor's Simple CMS System</title>
<link href="../style.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr bgcolor="#464646">
<td height="90" colspan="2" bgcolor="#464646"><span class="sitetitle">Jagadishwor's Simple CMS System</span></td>
<td height="90"> </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr> <tr>
<td colspan="2"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="dispaly">
<tr>
<td><form name="form1" method="post" action="">
<table width="96%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><h1><a href="article.php?id=1">Welcome admin Please click on the menu for your work. </a><span> </span></h1></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="3" cellpadding="3">
<tr>
<td><div align="right"><strong>Post Title </strong></div></td>
<td><input name="title" type="text" id="title" size="40"></td>
<td> </td>
</tr>
<tr>
<td><div align="right"><strong>Post Contents </strong></div></td>
<td><textarea name="contents" cols="40" rows="10" id="contents"></textarea></td>
<td> </td>
</tr>
<tr>
<td><div align="right"><strong>Category</strong></div></td>
<td><?php
$result = mysql_query("SELECT * FROM tblcategory");
echo "<select name=\"catg\" id=\"catg\">";
while($row2 = mysql_fetch_array($result))
{
echo "<option value=" . $row2['catid'] .">".$row2['catname'];
echo " </option>";
}
echo "</select>";
?></td>
<td> </td>
</tr>
<tr>
<td><div align="right"><strong>Post By </strong></div></td>
<td><input name="postby" type="text" id="postby"></td>
<td> </td>
</tr>
<tr>
<td><div align="right"><strong>Post Tags </strong></div></td>
<td><input name="tags" type="text" id="tags"></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><input name="addpost" type="submit" id="addpost" value="Add Post"></td>
<td> </td>
</tr>
</table></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td><center>
</center></td>
</tr>
</table>
</form></td>
</tr>
</table></td>
<td width="24%" bgcolor="#8c8c8c" valign="top" align="center"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30" bgcolor="#4d4d4d"><span class="archtitle">Admin Menu </span></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#FFFFFF" height="2px"></td>
</tr>
<tr>
<td height="20"><span class="menupost"><a href="addnew.php">Add New Post </a></span></td>
</tr>
<tr>
<td height="2" bgcolor="#ffffff"></td>
</tr>
<tr>
<td height="20"><a href="viewpost.php" class="menupost">View Post </a></td>
</tr>
<tr>
<td height="2" bgcolor="#ffffff"></td>
</tr>
<tr>
<td height="20"><a href="addcategory.php" class="menupost">Add New Category </a></td>
</tr>
<tr>
<td height="2" bgcolor="#ffffff"></td>
</tr>
<tr>
<td height="2" bgcolor="#ffffff"></td>
</tr>
</table></td>
</tr>
<tr>
<td height="30" bgcolor="#4d4d4d"> </td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td></td>
</tr>
<tr>
<td bgcolor="#FFFFFF" height="2px"></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr bgcolor="#6d6d6d">
<td width="33%" height="40"><span class="footertext">Copyright © <a href="http://www.jagadishwor.com.np">Jagadishwor.com.np</a> 2009</span></td>
<td width="43%"> </td>
<td><span class="footertext"><em>Version 1.0</em></span></td>
</tr> </table></td>
</tr>
</table>
<?php
if(isset($_POST['addpost'])){
$title=$_POST['title'];
$contents=$_POST['contents'];
$category=$_POST['catg'];
$postby=$_POST['postby'];
$today=date("Y-m-d");
$posttags=$_POST['tags'];
}
if(($title<>"") and ($contents<>"") and ($category<>"")){
$qry="INSERT into tblpost (heading, article, postdate, postby, catid, posttag, status) VALUES ('$title', '$contents', '$today', '$postby', '$category', '$posttag', '1')";
$result=mysql_query($qry);
if($result){
?>
<script>
alert("New Post added Successfully")
window.location("addnew.php");
</script>
<?php
}else{
echo "Can not add your post.";
}
}
?>
</body>
</html>
To view and delete your post create new file viewpost.php
<?php include '../include/constr.php';?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Jagadishwor's Simple CMS System</title>
<link href="../style.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr bgcolor="#464646">
<td height="90" colspan="2" bgcolor="#464646"><span class="sitetitle">Jagadishwor's Simple CMS System</span></td>
<td height="90"> </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr> <tr>
<td colspan="2"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="dispaly">
<tr>
<td><form name="form1" method="post" action="">
<table width="96%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><h1><a href="article.php?id=1">Welcome admin Please click on the menu for your work. </a><span> </span></h1></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="3" cellpadding="3">
<tr>
<td><div align="center"><strong>SNO</strong></div></td>
<td><div align="center"><strong>Title</strong></div></td>
<td><div align="center"><strong>Post Date </strong></div></td>
<td><div align="center"><strong>Category</strong></div></td>
<td><div align="center"><strong>Post By </strong></div></td>
<td><div align="center"><strong>Action</strong></div></td>
</tr>
<?php
$qry="SELECT a.*, b.catname FROM `tblpost` a, `tblcategory` b WHERE a.catid=b.catid ORDER BY a.postid DESC";
$result=mysql_query($qry);
$sno=1;
while($row=mysql_fetch_array($result)){
?>
<tr>
<td><?php echo $sno;?></td>
<td><?php echo $row['heading'];?></td>
<td><?php echo $row['postdate'];?></td>
<td><?php echo $row['catname'];?></td>
<td><?php echo $row['postby'];?></td>
<td><a href="viewpost.php?action=delete&id=<?php echo $row['postid'];?>">Delete</a></td>
</tr>
<?php
$sno=$sno+1;
}
?>
</table></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
</table>
</form></td>
</tr>
</table></td>
<td width="24%" bgcolor="#8c8c8c" valign="top" align="center"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30" bgcolor="#4d4d4d"><span class="archtitle">Admin Menu </span></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#FFFFFF" height="2px"></td>
</tr>
<tr>
<td height="20"><span class="menupost"><a href="addnew.php">Add New Post </a></span></td>
</tr>
<tr>
<td height="2" bgcolor="#ffffff"></td>
</tr>
<tr>
<td height="20"><a href="viewpost.php" class="menupost">View Post </a></td>
</tr>
<tr>
<td height="2" bgcolor="#ffffff"></td>
</tr>
<tr>
<td height="20"><a href="addcategory.php" class="menupost">Add New Category </a></td>
</tr>
<tr>
<td height="2" bgcolor="#ffffff"></td>
</tr>
<tr>
<td height="2" bgcolor="#ffffff"></td>
</tr>
</table></td>
</tr>
<tr>
<td height="30" bgcolor="#4d4d4d"> </td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td></td>
</tr>
<tr>
<td bgcolor="#FFFFFF" height="2px"></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr bgcolor="#6d6d6d">
<td width="33%" height="40"><span class="footertext">Copyright © <a href="http://www.jagadishwor.com.np">Jagadishwor.com.np</a> 2009</span></td>
<td width="43%"> </td>
<td><span class="footertext"><em>Version 1.0</em></span></td>
</tr> </table></td>
</tr>
</table>
<?php
if(isset($_GET['action'])){
$id=$_GET['id'];
if($id<>""){
$sql="DELETE FROM tblcategory WHERE catid='$id'";
echo $sql;
$result=mysql_query($sql);
if($result){
?>
<script>
alert("Article Deleted.")
window.location=("viewpost.php");
</script>
<?php
}
}
}
?>
</body>
</html>
OK finally to add category create page addcategory.php
<?php include '../include/constr.php';?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Jagadishwor's Simple CMS System</title>
<link href="../style.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr bgcolor="#464646">
<td height="90" colspan="2" bgcolor="#464646"><span class="sitetitle">Jagadishwor's Simple CMS System</span></td>
<td height="90"> </td>
</tr>
<tr>
<td colspan="3"> </td>
</tr> <tr>
<td colspan="2"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="dispaly">
<tr>
<td><form name="form1" method="post" action="">
<table width="96%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><h1><a href="article.php?id=1">Welcome admin Please click on the menu for your work. </a><span> </span></h1></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="3" cellpadding="3">
<tr>
<td><div align="right"><strong>Category Name </strong></div></td>
<td><input name="catname" type="text" id="catname" size="40"></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><input name="addcategory" type="submit" id="addcategory" value="Add New Category"></td>
<td> </td>
</tr>
</table></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td><center>
</center></td>
</tr>
</table>
</form></td>
</tr>
</table></td>
<td width="24%" bgcolor="#8c8c8c" valign="top" align="center"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30" bgcolor="#4d4d4d"><span class="archtitle">Admin Menu </span></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#FFFFFF" height="2px"></td>
</tr>
<tr>
<td height="20"><span class="menupost"><a href="addnew.php">Add New Post </a></span></td>
</tr>
<tr>
<td height="2" bgcolor="#ffffff"></td>
</tr>
<tr>
<td height="20"><a href="viewpost.php" class="menupost">View Post </a></td>
</tr>
<tr>
<td height="2" bgcolor="#ffffff"></td>
</tr>
<tr>
<td height="20"><a href="addcategory.php" class="menupost">Add New Category </a></td>
</tr>
<tr>
<td height="2" bgcolor="#ffffff"></td>
</tr>
<tr>
<td height="2" bgcolor="#ffffff"></td>
</tr>
</table></td>
</tr>
<tr>
<td height="30" bgcolor="#4d4d4d"> </td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td></td>
</tr>
<tr>
<td bgcolor="#FFFFFF" height="2px"></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr bgcolor="#6d6d6d">
<td width="33%" height="40"><span class="footertext">Copyright © <a href="http://www.jagadishwor.com.np">Jagadishwor.com.np</a> 2009</span></td>
<td width="43%"> </td>
<td><span class="footertext"><em>Version 1.0</em></span></td>
</tr> </table></td>
</tr>
</table>
<?php
if(isset($_POST['addcategory'])){
$catg=$_POST['catname'];
}
if($catg<>""){
$sql="INSERT into tblcategory (catid, catname) values(NULL, '$catg')";
$result=mysql_query($sql) or die('Can not Add New Category');
if($result){
echo "Category Added. Returning Back. Please Wait";
?>
<script>
alert("Category added returning to back")
window.location=("addcategory.php");
</script>
<?php
}
}
?>
</body>
</html>
Wow! you complete your CMS system. I hope you understand all my codes. It’s very easy way to develop CMS System using php and mysql. I am developing a CMS system which will be online for all my readers who want their own CMS system very soon.
