Designing your own CMS Part II

So in last post it was only covered till how to make the Photoshop graphics and export it and load it into your localhost folder. In this post we will setup some small things.

Now open index.php with Notepad. [Yes I use notepad 🙁 ]

Change id=”Table_01″ to class=”box1″ and also add another attribute, align=”center”

Also add <link rel=”stylesheet” type=”text/css” href=”style.css”> between the <head></head> part.

Download the style.css from here.

Now open your http://localhost/ and start your phpMyAdmin.

Create a new database in it called “citycms”

Okay close it for now.

Now back in your citycms folder on your localhost, create a new folder in it called “include”.

Create two files in it.

1) functions.php

2) config.php

Code for functions.php is :

<?php
$link = “”;
function dbconnect()
{
global $link;
include(“config.php”);
$link = mysql_connect( $host, $user, $pass );
if (! $link )
die(“Couldn’t connect to MYSQL”);
mysql_select_db( $database, $link)
or die(“Couldn’t open $database: “.mysql_error() );
}
?>

Code for config.php

<?php
$database = “citycms”;
$user = “root”; //If you are using any other user then put that user here.
$pass = “”; //If you are supplying a password then put the password here.
$host = “localhost”;
?>

Okay so the half of the things are set. In next post we will make tables in database to store the data and we will use .htaccess to make SEO friendly URL’s for the site.

You Might Also Like