Eternal Contact Info

By Jay Jennings

Anyone with multiple sites knows what a pain it is when something like your contact info changes -- you have to track down every instance of your name and address and update it. And someone like me, with itchy feet, has to do that more often than not!

So this time I decided to use my Master Ninja Programming Skills to create a little doohickey I can use on ALL my sites -- and when I need to change contact info all I have to do is make ONE change and every page out there changes automatically.

It's not rocket science, but it's very handy. And easy enough that anyone, even someone without Master Ninja Programming Skills, should be able to implement it -- as long as you can upload one file to your web site and paste in a line of HTML code.

 

-- An Example --

Here's my contact info:

I didn't type that in, I pasted in one line of code -- this:

   <script language="JavaScript" type="text/javascript" src="http://mydomain.com/somefile.php?type=addr">

If I want to show my full contact info I can use that same line of code, but instead of:

   type=addr

...toward the end of that line, I'll use:

   type=full

Pretty nice, eh? And if I want to make my email address clickable, I can just add this to the line of code:

   &linked=1

...and it'll spit out this:

Woohoo! The best thing about this little utility is that in the future when my contact info changes, I'll make ONE change and every site that uses this little trick will change magically.

 

-- You Can Do This, Too --

I'm going to give you the small PHP file to put up on your web site and I'll show you the simple edits you need for it to work. And even though the tool itself is PHP, the technique should work on a plain HTML page, too.

Step 1 - Download The File
Right-click the following link and save the file to your hard drive:

Eternal Contact Info

Step 2 - Unzip And Open In Notepad
After you unzip the archive (using Winzip, or just right-click on the file and choose Extract) open it in Notepad or some other text editor -- do not use a word processor to edit the file. You can also use Fronpage or Dreamweaver, but you'll be doing your editing in "source view" so the WYSIWYG part won't be a benefit.

Step 3 - Put In Your Own Info
The first 20 lines or so are taken up with file info and instructions, but then you should see the following:

        // --------------------------------------------------------------
        // Change the fields below -- only inside the double quote marks.
        // --------------------------------------------------------------
        
        $name = "Your Name";
        $addr1 = "123 Street Address";
        $addr2 = "City, State Zip";
        $phone = "(Pho) neN-umbr";
        $email = "email@example.com";

        // --------------------------------------------------------------
        // Do not change anything below here!
        // --------------------------------------------------------------

Where it says Your Name change that to your actual name (or even company name if you like). Where it says 123 Street Address, put your street address, and so on. It's that easy.

Step 4 - Save Changes And Upload!
When you've made all the changes, save the file and then upload it to your web site. It doesn't really matter where it lives, it's just going to sit there and spit back the info whenever it's asked for it.

 

-- How To Use It --

Now you're ready to paste that single line of code into your web page wherever you need your contact info to show up. Let's take a look at how that line of code is created:

<script language="JavaScript" type="text/javascript" src="http://mydomain.com/somefile.php?type=addr">

The part we really care about is the src="" part. That needs to be changed to point to the eternalcontactinfo.php file you uploaded. So if your domain name is magnasite.com, the first part of that will look like this:

   http://magnasite.com/eternalcontactinfo.php

There are two more things we can tack onto the end of the URL -- what type of info we want returned, and whether the email address should be clickable. Here are the options for the type of address we want returned:

  • type=addr -- Displays name and mailing address.
  • type=full -- displays all contact info.
  • type=noaddr -- Displays just name, phone, and email.
  • type=nameemail -- Displays just name and email address.

To put one of those onto the end of the URL, just connect it with a question mark, like this:

   http://mangasite.com/eternalcontactinfo.php?type=full

Only one more option to choose -- do you want the email address to be clickable? If so, add one more thing onto the end -- this time connect it using an ampersand (the & sign):

   http://mangasite.com/eternalcontactinfo.php?type=full&linked=1

That's all there is to it! Once you create the line of code that you use the most, save it in a text file somewhere so you can quickly and easily grab it again and again, whenever you make a new web page and want to include your contact info.

 

-- Is This Helpful? --

Like I said before, this isn't rocket science, but it has the potential to save you a lot of time in the future. If you like this free tool, please help keep me going by making a donation via payPal -- whatever you think this little utility is worth. $5, $10, or more, you make the call:

 

PS - Here's an extra bonus...

You know how you always have to change the copyright notice at the bottom of your pages each year? Well, I added that in to Eternal Contact Info so you can use a line like this:

   <script language="JavaScript" type="text/javascript" src="http://mydomain.com/somefile.php?type=copyright&linked=1">

...and it will put in a copyright notice with your name and the current year! Again, if you find this useful, please use the Donate button and let me know!

 

PS - If you're not on my list and want to be informed when I do things like this again, please join my Select Marketing Info list:

Name
Email

 

PPS - Yep, the copyright notice below was done using the Eternal Contact Info trick! =;)