UltraDev 101

Converting Emails and URLs into Working Links from the Database
  


  


Email Links



On our "details.asp" page we have two items displayed for each person: an email address and their website.

Here’s how to make them active links. You have to open up the HTML to do this. Scroll down to where the email link is. And as of right now it’s not a link at all. So put the tags around it like this:

<%=(rsGetDetails.Fields.Item("email").Value)%>

Then just copy <%=(rsGetDetails.Fields.Item("email").Value)%> and paste it after "mailto:". Now your final code should be like this:

<a href="mailto:<%=(rsGetDetails.Fields.Item("email").Value)%>">
<%=(rsGetDetails.Fields.Item("email").Value)%>
</a>


What this does is grab the email from the database twice. Once to be displayed to the user, which is between the tags. And then the other is in the actual mailto:emailaddress code.


URL Links



The same thing pretty much applies for URL’s as well. Except rather than using "mailto:" you’ll use "http://". In our case the code will need to look like this:

<a href=http://<%=(rsGetDetails.Fields.Item(url").Value)%>" target="blank">
<%=(rsGetDetails.Fields.Item("url").Value)%>
</a>


Target="_blank" just means that the website will open in a new window.
  


  




© Copyright 1999-2001/ USA America Inc.All rights reserved. Last updated --  Read our Privacy Policy

  
Webmaster & Submissions:
Contact Administration

Site Advertising:
Rates and Information


» Get tutorial template
» Virtual-FX Team




 

Download the buttons
Join our mailing list!
Enter your Email address below, then click the 'Join List' button: 

Subscribe Unsubscribe
Powered by ListBot