Search Marketing

   
   

Search Engine Marketing

A work-in-progress devoted to providing advice and techniques to better market your product or service. Subjects covered range from MySQL, PHP, SEO and technology Investing.

We use christonium.com to manage all our content because it is very flexible and allows many subject within Search Engine Marketing to be covered. Anyone can create a free social website on christonium.com. Site Map of Search Engine Marketing

Latest Article:

Subdomain or Directory – Which is Better for SEO?

Asus Eee PC 900 Laptop Review

Renaming Table Fields Using Alter & Change Command


Comments: 0

You can easily change any table field name in MySQL using the “ALTER” command by specifying the “CHANGE” option.

Lets assume we have the following database table.

mysql> select * from Name;
+----+--------+---------------------+
| ID | Name | Date |
+----+--------+---------------------+
| 1 | Joe | 2001-02-12 00:00:00 |
| 2 | Jack | 2003-03-15 00:00:00 |
| 3 | John | 1980-05-15 00:00:00 |
| 4 | James | 1994-09-21 00:00:00 |
| 5 | George | 1996-12-11 00:00:00 |
+----+--------+---------------------+

If we wanted to change the name of the Date field to StartDate, we would use the following command. Remember to backup your database, or copy the /var/lib/mysql source files to a safe location before attempting to utilize commands that may change the structure of your database.

mysql> alter table Name change Date StartDate timestamp;
Query OK, 5 rows affected (0.42 sec)
Records: 5 Duplicates: 0 Warnings: 0

mysql> select * from Name;
+----+--------+---------------------+
| ID | Name | StartDate |
+----+--------+---------------------+
| 1 | Joe | 2001-02-12 00:00:00 |
| 2 | Jack | 2003-03-15 00:00:00 |
| 3 | John | 1980-05-15 00:00:00 |
| 4 | James | 1994-09-21 00:00:00 |
| 5 | George | 1996-12-11 00:00:00 |
+----+--------+---------------------+

Using these simple commands will allow you to fix problems and clean up any naming mistakes made early on in the programming process.



Using PHP to Check the Formatting of Email Addresses


Comments: 0

The below example makes use of PHP and Regular Expressions to breakdown what someone might type into an email field and make sure that it fits the general format.

$email = "test@test.com";

if(eregi("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$", $email))
{
// echo "Valid email address.";
return(1); // true
}
else
{
// echo "Invalid email address.";
return(0); // false
}

To learn more about using regular expressions this tutorial has some good information for beginners.

Using an Array for Web Page Titles


Comments: 0

This post is designed to encourage the use of separate and specific web page titles using PHP, without the need for a database. While this is not the only way, or best way to accomplish page titling, it is nonetheless a useful and easy to work with.

Lets assume you have a website with 5 pages.

Home
About
Products
Services
Contact

The goal is to present the visitor with unique titles for each page.

If you are using a scripting language like PHP to construct your documents then you might have made a simple page like the following.

<html>
<head>
<title><?= $call_title; ?></title>
</head>
<body>

<!-- web page navigation -->

<a href=”?page=home”>Home</a>
<a href=”?page=about”>About</a>
<a href=”?page=products”>Products</a>
<a href=”?page=services”>Services</a>
<a href=”?page=contact”>Contact</a>

<!-- place for content of pages -->

<?php

if(!$_GET['page'])
include "includes/home.php";
else
include "includes/$page.php";

?>

</body>
</html>

You essentially have six files.

index.php
/includes/home.php
/includes/about.php
/includes/products.php
/includes/services.php
/includes/contact.php

Begin with creating an array of the titles. For simplicity we will just use basic titles. You should conduct the proper marketing research to determine what will work best for your company.

$pages = array('home','about','products','services','contact');

$select_page = array_search($_GET['page'], $pages);

$new_title = array('Home Page', 'About Area', 'Product Pages', 'Our Services', 'Contact Us');

$call_title = $new_title[$select_page];

The code above would be placed at the top of index.php, above any html.

The finished version would look like this:

<?php

$pages = array('home','about','products','services','contact');

$select_page = array_search($_GET['page'], $pages);

$titles = array('Home Page', 'About Area', 'Product Pages', 'Our Services', 'Contact Us');

$call_title = $titles[$select_page];

?>

<html>
<head>
<title><?= $call_title; ?></title>
</head>
<body>

<!-- web page navigation -->

<a href=”?page=home”>Home</a>
<a href=”?page=about”>About</a>
<a href=”?page=products”>Products</a>
<a href=”?page=services”>Services</a>
<a href=”?page=contact”>Contact</a>

<!-- place for content of pages -->

<?php

if(!$_GET['page'])
include "includes/home.php";
else
include "includes/$page.php";

?>

</body>
</html>