close ad
 
Important WebAssist Announcement
open ad
View Menu

Web development tutorial

How to create a simple SEO CMS

Tutorial created by Christopher West, Freelancer Looking for Work

Categories: Data Bridge

rating

This tutorial explains how to create a simple backend system for the website admin to manage certain aspects of SEO of their website.

arrow downRequired

DataBridge

arrow downPreparation

The database table ...

Ok, keeping things simple as possible I will create a basic MySQL database table this will contain the metatags for Title, Description & Keywords as well as a field to store the metatag for robots and lastly a field that will store the page location (the page location will be used for what ever page your referencing using a simple recordset on that page (i.e. for the homepage which would be index.php I will reference this in the database table as Location = Homepage in the recordset in index.php so that it will pull in the data from the database for that particular page.

Step 1: The Database Table

CREATE TABLE IF NOT EXISTS `seo` (
`SEOID` int(11) NOT NULL AUTO_INCREMENT,
`SEOTitle` varchar(255) NOT NULL,
`SEOLocation` varchar(100) NOT NULL,
`SEODescription` varchar(255) NOT NULL,
`SEOKeywords` varchar(255) NOT NULL,
`SEORobots` varchar(17) NOT NULL,
PRIMARY KEY (`SEOID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

Step 2: The HTML Form (for the Update page)

html:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<form method="get" name="seoupdate">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20%">Location</td>
<td width="30%"><select name="Location">
<option value="Homepage">Homepage</option>
<option value="About">About</option>
<option value="Services">Services</option>
<option value="Contact">Contact</option>
</select></td>
<td width="50%"></td>
</tr>
<tr>
<td><label for="title">Title</label></td>
<td><input name="Title" type="text" id="Title" maxlength="255"></td>
<td></td>
</tr>
<tr>
<td><label for="description">Description</label></td>
<td><input name="Description" type="text" id="Description" maxlength="255"></td>
<td></td>
</tr>
<tr>
<td><label for="keywords">Keywords</label></td>
<td><input name="Keywords" type="text" id="Keywords" maxlength="255"></td>
<td></td>
</tr>
<tr>
<td><label for="robots">Robots</label></td>
<td><select name="Robots">
<option value="index, follow">index, follow</option>
<option value="index, nofollow">index, nofollow</option>
<option value="noindex, follow">noindex, follow</option>
<option value="noindex, nofollow">noindex, nofollow</option>
</select></td>
<td></td>
</tr>
<tr>
<td></td>
<td><input name="Submit" type="submit" value="Submit" ></td>
<td></td>
</tr>
</table>
</form>
</body>
</html>

Step 3: The Homepage (Index.php)

Create a connection to the database and create a recordset on the index.php and using the Location field to filter the table for Homepage ...







Then add the bindings for title, description, keywords and robots to the same parts of the html code with the same names:

<title><?php echo $row_rsSEO['SEOTitle']; ?></title>
<meta name="Description" content="<?php echo $row_rsSEO['SEODescription']; ?>">
<meta name="Keywords" content="<?php echo $row_rsSEO['SEOKeywords']; ?>">
<meta name="robots" content="<?php echo $row_rsSEO['SEORobots']; ?>">

arrow downCreating the Update Form using DataBridge

First we need to add a recordset to the update page (since this will be used for "any" pages it needs to be filtered with a URL Parameter).

To bring this URL Parameter into this page you would generally have a link in your admin area something like this

<a href="seo-update.php?SEOLocation=Homepage">Update Homepage</a>

Step 1: Create the recordset on the update page

You then need to create a recordset and filter the SEOLocation field from the database as URL Parameter.

Step 2: Add the bindings to the form

Then add bindings to each of the fields, with the select lists you need to click on the select box on the form then in the Properties panel click Dynamic icon which will then open up a new panel, from there click on the small lightening bolf where it says "SELECT value equal to:" then select the SEORobots field from the recordset.

Step 3: Add the WebAssist Update Behaviour

Step 4: Configure the Update Behaviour

In the general tabmake the trigger the forms button, then select the database base in the connection dropdown, select the table that you created earlier and the Key Column would be the SEOLocation field ... For the value you would then click on the small lightening bold and select SEOLocation from the recordset ...you can then enter the optional page for the After Update (this would go to what ever page you want it to go to after the update has processed).



In the Bindings tab you would then click on the small lightening bolt in turn for each of the form elements corrisponding to the table names.

arrow downReviews and comments

Comments will be sent to the author of this tutorial and may not be answered immediately. For general help from WebAssist, please visit technical support.

Sign in to add comments
rating
rating

Miguel: 10 Years, 11 Months, 5 Days, 1 Hour, 24 Minutes ago

Good tutorial thumbs up

YellowCircleWeb: 10 Years, 11 Months, 1 Day, 20 Hours, 45 Minutes ago

Nice one

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.