Wednesday, April 19, 2006

Anchor tags with different styles

I was trying to get different anchor styles from an external css to work on my site. It was not doing what it was supposed to do for some reason. When I searched for the problem, i found that the tags must be declared in a specific way (Link, Visited, Hover, Active). If they are not declared in this way, the anchors will not work properly.

Now say we have a page A where we want to the anchor tags to have style S1. We can do the following:

<html>
<body class="wrapped">
</body>
</html>

.wrapped a:link {properties}
.wrapped a:visited {properties}
.wrapped a:hover {properties}
.wrapped a:active {properties}

where wrapped in the className, or we can define each anchor tags as such

<a href="#" class="bar">My Link</a>

a.bar:link {properties}
a.bar:visited {properties}
a.bar:hover {properties}
a.bar:active {properties}

Friday, March 31, 2006

What if Activation Links in Emails dont work?

When people register on your site and you decide to send them an email with an activation link to click thereby confirming their email address, sometimes it doesnt work. Well clicking on the link might give an HTTP 404 error. Why? It can be because the link is displayed on two lines rather than one.

For example, if your link is something like this http://www.blabla.com/register.php?username=myblabla&activation_code=ARHG878787, it might be displayed on two lines as follows in certain email programs:

http://www.blabla..com/register.php?username=myblabla
&activation_code=ARHG878787

Even if the user has selected the two lines, the clipboard might be copying just the first line (dont ask me why now). So unless the user copies the first line, paste in the address bar and does the same for the second line, the link wont work!!!

Solution is to have a simple link like:
http://www.blabla..com/register.php

Then ask the user to type in the username and the activation code which you gonna provide in the email. Your register.php page need only have 2 fields, username and activation code and upon successful entry activates the account for that user.

Thursday, March 09, 2006

I lost my sign-in details a 2nd time!!!

I cant believe it, i forgot the username and password for the second time!

I just have to make a note of it this time.