Friday, October 25, 2024

Easy Web Site Personalization With PHP

Is your web site dynamic enough to address your visitors by name?

If not, you are missing out on a powerful personalization strategy that could treble your sales or more.

This article gives you a simple five step process you can follow to quickly add some personalization to your web pages. All you need to use is a bit of PHP.

If the mere mention of PHP fills you with programming paralysis, you have no need to fear. It’s incredibly simple, not much more difficult than HTML – if you can do basic HTML, you can do PHP.

The vast majority of hosts, both on Windows and Unix, support PHP – if you’re unsure, just check with your host.

STEP 1: Make Your Web Page a PHP Page

Most web pages end with the extension .html or .htm. All you need to do is change this to .php (or occasionally something like .php3 depending on your host).

One note of caution – if you are using SSI, there may be SSI commands on your page that will need to be converted to PHP commands. This is outside the scope of this article.

Also, if you normally use something like FrontPage, you may run into problems with this, so just use something like Notepad instead.

STEP 2: Create A Box For The Name

We are going to store the visitor’s name in what is commonly called a ‘variable’, so that we can use it later on your web page.

All you need to do is put the following code at the very top of your web page:

-==-

Replace ‘Friend’ with whatever term you want to use to address visitors if you haven’t yet captured their name – we talk about how to capture their name later in this article.

Don’t worry about what the rest of this code does. It’s just there to make sure the whole system works – if the visitor’s browser allows cookies, they’ll still see their name when they revisit your web site in the future.

STEP 3: Capture Their Name

This is the bit where you throw a rope round their name and string it up on your web site to grab their attention!

Here’s one way to do it – just add a bit extra to the normal URL to your web page.

Take a look at this example:

-==-

You just add ?f=Fred (or whatever the first name of the person is) to your URL.

Yes, I know – this is only useful if you provide a link in something like a newsletter, and if you use a mailing service that permits personalization. But some solo ad publishers also permit personalization, so you can use it there too!

Another way is to capture their name when they fill in a form to subscribe to your ezine, for example. But this would require more space than I have room for in this article.

STEP 4: Speak To Them By Name

So you’ve got their name – now you can use it to speak to them in person across your whole web site!

Here’s how you do it.

Wherever you want to display their name, just type in the following instead:

-==-

As long as your web page is a PHP page, as discussed in Step 1 above, this will display the visitors name, if you have it. Otherwise it will display the default, which in my code above is ‘Friend’.

STEP 5: Upload The Code

Upload the PHP page to your web site, and test it.

First visit the page normally, for example going direct to http://www.yourdomain.com/index.php – you should see ‘Friend’ wherever you wanted the first name to go to.

Now visit it by typing a URL like the following into your browser: http://www.yourdomain.com/index.php?f=Bob. Wherever it said ‘Friend’ it should now say ‘Bob’ – you may need to reload the page to overcome the browser cache.

There’s no better way to grab your visitors’ attention than to actually address them by their first names!

Steve Shaw develops systems and software to help you
succeed in your online business. The article above has been
extracted and condensed from his e-course on how to publish
articles to promote your web site – to receive the full
e-course direct to your mail box, and also discover a much
quicker, highly efficient way to submit your articles, sign
up now at:

http://www.takanomi.com/publish-articles.php.

Previous article
Next article

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles