copyright-date-change

Automatically Update the Copyright Year

This little trick will automatically refresh the copyright year by inserting a simple JavaScript or php script. Although not required by law, it tells your visitor the site is current and can also reflect the longevity of your site when using the multiple years approach.

Using Javascript

Here’s the JavaScript. Copy and paste it wherever you want the current year to appear:

<script language=”javascript” type=”text/javascript”>
var today = new Date()
var year = today.getFullYear()
document.write(year)
</script>

Using php

Here’s the php script:

<?php echo date(‘Y’); ?>

The php script will require an additional step to make it run on html pages (not required for WordPress). You need to create or edit an .htaccess file. Adding this snippet of code to the .htaccess file will also allow other php scripts to run on your site, which can be extremely useful.

Creating the .htaccess File

To set up an .htaccess file, open a new file or open the existing .htaccess file in a text editor like Notepad or SimpleText. Paste the following code into the file:

AddType application/x-httpd-php .htm .html

After inserting the code in your text editor, click File > Save. For a new file, type .htaccess as the file name and from the Save as type dropdown menu, select All Files. Click Save, then go back and make sure the editor didn’t add an extension to the filename after .htaccess. If you find an extension, delete it. Upload the .htaccess file to the root directory of your website. This is the topmost folder of your website’s file structure and is usually named example.com or example.com/home.

(You may need to search your web host’s site for “How to parse php within html files”, as your web host might specify a different process for parsing php in html pages. Follow those directions instead on what code to enter in the .htaccess file.)

Updating Your Blog’s Copyright

You may not have access to the .htaccess file depending on what blogging platform your website uses. In that case, use the JavaScript code.

Copyright That Spans Several Years

A range of years next to your copyright symbol will remind your visitors how long you’ve been in business or how long your website has been up. Use the script to update the last year of your range. To do this, copy and paste the following as your copyright notice’s html code. Change 2006 to the year in which your site was established:

Copyright &copy; 2006&ndash;

Enter the JavaScript or php script for the current year immediately next to the semicolon.

Your copyright year updates are now automated.

move-email-server-cpanel

Moving Email from One cPanel Server to Another

It is not unusual to change hosting service providers when you are not happy with the service of your present provider. One problem in doing so is the problem of moving email accounts, especially when you have plenty of them stored on the server and you cannot afford to give them away. So, when you move your hosting account from one server to another, the issue that would bother you most is how you can move all emails stored in the old server to the corresponding email accounts on the new server.

If your hosting cpanel provides for taking full backup of your root directory, an easier method would be to download a full backup from the old server and restore it on the new server. This will automatically create all your email accounts on the new server with same passwords and copy all the old email files. This article becomes relevant when you do not have such a facility or for some reason you do not want to do a full backup-restore (not wanting to disturb your website files on the new server).

In this article I will demonstrate how to move emails from one hosting server to another. This is actually quite a simple task if your source and destination accounts are both on cPanel.

Step 1. Create Email accounts on the new server

As a first step, create all your email accounts on the new server, as they exist on the old server. This can be done from your cPanel control panel on the new server. To do this, the iconized link you need to click in your new cpanel is – Email Accounts.

step-1

Step 2. Download Emails from the old server

Next, connect to your old hosting account via FTP and download all your email related directories and files.

After establishing FTP connection (using any standard ftp client), navigate to the root directory of your hosting account. You will see a directory structure somewhat like shown below.

step-2

All your emails are under the mail directory. When you drill down to the mail directory, you will see a directory structure somewhat like shown below. You need to download everything under the mail directory.

step-2b

Just for the sake of understanding …

Drill down to the directory yourdomainname.com. In our example, it is how2lab.com. You will see a directory structure as shown below. Here each listed directory corresponds to an email account that you have on your old server.

step-2c

Drill down further to any one of the listed sub-directories. You will see a structure as below. These are your email folders and some or all of them will be containing your email files, which are essentially required to be moved to the new server.

step-2d

Instead of moving emails directory by directory, it would be much easier to simply download the entire set of directories and folders under mail directory. So, download everything under the mail directory into your local computer.

Step 3: Move Emails to the new server

Now, disconnect from the old server and connect to the new server via FTP. Navigate to the mail directory on the new server. Upload everything that you downloaded from the old mail directory on to the new mail directory. This will copy everything on the new server. If you already had some emails on the new server (in case you decided to move emails from old server after having operated the new one for some time), you do not have to worry. They will remain intact and your old mails will simply get added on to the corresponding directories on the new server.

Once all files are uploaded, you are DONE. You can verify that old mails have indeed moved into your newly created email accounts, by logging into your new email accounts using a webmail interface.

email-to-text

Forwarding Gmail messages as text messages or SMS

I love my gmail account because of all the integrated features Google offers, such as the ability to synchronize email contact lists and browser favorites via Google Chrome, to name a few. Additionally, I don’t consider a new website for a client complete unless I integrate Google Analytics into their meta data. It seems no matter the need, Google has an answer.

My most recent “need” involved the desire to forward email messages from a specific sender as a text message (SMS) to my cell phone. I use Mozilla Thunderbird as my email client on my desktop, but I wanted a way to forward the messages as soon as gmail receives them and before I view them on my desktop via Thunderbird. Sure enough, Google had the answer!

Getting this to work involved a bit of tweaking of my Gmail account settings as well as determining my cellular carrier’s text messaging address format. Here is a simple two-step process I used to make this happen:

1. Determine your cellular carrier’s text messaging (SMS) address

Most, if not all, cellular carriers will provide the ability to send a text message via an email address. Here is a listing of the major carriers. Please note I have not verified all carrier’s addresses, only AT&T as this is my current carrier.

AT&T:
  • my10-digitcellphonenumber@txt.att.net (the text message sender will be a random phone number)
  • my10-digitcellphonenumber@mms.att.net (I prefer using mms because the text message sender will be the email address that is forwarding the message)
Verizon:
  • my10-digitcellphonenumber@vzwpix.com (mms)
  • my10-digitcellphonenumber@vtext.com (text)
Sprint:
  • my10-digitcellphonenumber@pm.sprint.com (mms)
  • my10-digitcellphonenumber@messaging.sprintpcs.com (text)
T-Mobile:
  • my10-digitcellphonenumber@tmomail.net (text)
US Cellular:
  • my10-digitcellphonenumber@email.uscc.net (mms)
  • my10-digitcellphonenumber@mms.uscc.net (text)

If your carrier is not listed, do a Google search to find it. Chances are, the service is available.

2. Set up a Gmail email filter

You will need to sign in to your Gmail account via any web browser. (www.mail.google.com is the URL). Once signed in, do this:

  • Click on the Settings link in Gmail. This is located near the upper right when clicking on the little gear-looking icon.
  • Click on the Forwarding an POP/IMAP tab that runs along the top of the window.
  • Select Add a forwarding address under Forwarding section.
    • You do not have to select Forward a copy of incoming mail to for this to work; Disable forwarding can be selected under Forwarding:, and your existing Gmail forwarding settings will not be changed.
  • Enter the address to which you want Gmail to forward mail under Add a forwarding address. This will be one of the cellular carrier text message addresses listed in step 1.
  • Click Next, and on the next screen click Proceed.
  • Now click OK under A confirmation code has been sent to verify permission. You will receive a text message with a confirmation code. Enter that code into the confirmation box in in the Forwarding an POP/IMAP tab and click verify.
  • Back in Gmail settings, go to the Filters tab.
  • Click Create a new filter at the bottom.
  • Enter your search criteria under Choose search criteria.
    • To forward all mail (like the standard Gmail forwarding does), enter “@” in the From: field, for example.
    • To forward mail from a certain sender, enter their email address, name, domain or any part of these under From:.
  • Click Create filter with this search ».
  • Make sure Forward it to: is checked.
  • Select the desired email address to receive the forwarded emails under Forward it to:.
  • Click Create Filter.

Follow these two steps and you will be pleased with the result. It works like a charm for me!