This tutorial explains how to create a simple backend system for the website admin to manage certain aspects of SEO of their website.
DataBridge
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.
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 ;
<!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>
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']; ?>">
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>
You then need to create a recordset and filter the SEOLocation field from the database as URL Parameter.
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.
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.
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 commentsYour friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
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.
Miguel: 11 Years, 8 Months, 6 Days, 9 Hours ago
Good tutorial thumbs up
YellowCircleWeb: 11 Years, 8 Months, 3 Days, 4 Hours, 21 Minutes ago
Nice one